From 7fe5f4cd4e3697880a21d44add45f31d2db96e38 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Tue, 28 Jan 2020 12:36:30 -0600 Subject: [PATCH] Added fixes for Net3 --- IPA.Loader/Utilities/Accessor.cs | 4 ++++ Net3-Proxy/Extensions.cs | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/IPA.Loader/Utilities/Accessor.cs b/IPA.Loader/Utilities/Accessor.cs index a612e097..ad1cd89c 100644 --- a/IPA.Loader/Utilities/Accessor.cs +++ b/IPA.Loader/Utilities/Accessor.cs @@ -3,6 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Emit; +#if NET3 +using Net3_Proxy; +using Array = Net3_Proxy.Array; +#endif namespace IPA.Utilities { diff --git a/Net3-Proxy/Extensions.cs b/Net3-Proxy/Extensions.cs index 89b75da0..499c63e5 100644 --- a/Net3-Proxy/Extensions.cs +++ b/Net3-Proxy/Extensions.cs @@ -19,14 +19,17 @@ namespace Net3_Proxy => (T)GetCustomAttribute(element, typeof(T)); public static T GetCustomAttribute(this ConstructorInfo element) where T : Attribute => (T)GetCustomAttribute(element, typeof(T)); + public static T GetCustomAttribute(this Type element) where T : Attribute + => (T)GetCustomAttribute(element, typeof(T)); public static Attribute GetCustomAttribute(this MemberInfo element, Type attributeType) => Attribute.GetCustomAttribute(element, attributeType); public static Attribute GetCustomAttribute(this ConstructorInfo element, Type attributeType) => Attribute.GetCustomAttribute(element, attributeType); - public static Attribute GetCustomAttribute(this ParameterInfo element, Type attributeType) => Attribute.GetCustomAttribute(element, attributeType); + public static Attribute GetCustomAttribute(this Type element, Type attributeType) + => Attribute.GetCustomAttribute(element, attributeType); public static StringBuilder Clear(this StringBuilder sb) => sb.Remove(0, sb.Length);