diff options
author | Marek Safar <marek.safar@gmail.com> | 2012-12-04 21:27:35 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2012-12-04 21:47:01 +0400 |
commit | a61f1d1c1d5a7b223ccb05221c8aecde13c8869b (patch) | |
tree | 767d71bd9819586190e09a2e3198777e50158ab7 | |
parent | 804ff756b9dfd03b4c5e92916e2381172358241e (diff) |
ifdef same extension method which exists in 4.5 mscorlib
-rwxr-xr-x | mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs index 8db9136f700..43b846aaad7 100755 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs @@ -74,14 +74,16 @@ namespace System.Runtime.Serialization exists (and raises InvalidOperationException if required). */ + internal static class TypeExtensions { +#if !NET_4_5 public static T GetCustomAttribute<T> (this MemberInfo type, bool inherit) { var arr = type.GetCustomAttributes (typeof (T), inherit); return arr != null && arr.Length == 1 ? (T) arr [0] : default (T); } - +#endif public static IEnumerable<Type> GetInterfacesOrSelfInterface (this Type type) { if (type.IsInterface) |