Parcourir la source

2010-03-31 Rodrigo Kumpera <[email protected]>

	* Module.cs:
	* MonoModule.cs: Implement GetCustomAttributes.

svn path=/trunk/mcs/; revision=154590
Rodrigo Kumpera il y a 15 ans
Parent
commit
6237214a46

+ 5 - 0
mcs/class/corlib/System.Reflection/ChangeLog

@@ -1,3 +1,8 @@
+2010-03-31 Rodrigo Kumpera  <[email protected]>
+
+	* Module.cs:
+	* MonoModule.cs: Implement GetCustomAttributes.
+
 2010-03-31 Rodrigo Kumpera  <[email protected]>
 
 	* Module.cs:

+ 11 - 11
mcs/class/corlib/System.Reflection/Module.cs

@@ -129,17 +129,7 @@ namespace System.Reflection {
 
 		[MethodImplAttribute (MethodImplOptions.InternalCall)]
 		internal static extern int GetMDStreamVersion (IntPtr module_handle);
-	
-		public virtual object[] GetCustomAttributes(bool inherit) 
-		{
-			return MonoCustomAttrs.GetCustomAttributes (this, inherit);
-		}
-	
-		public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) 
-		{
-			return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
-		}
-	
+
 		public FieldInfo GetField (string name) 
 		{
 			if (IsResource ())
@@ -508,6 +498,16 @@ namespace System.Reflection {
 		{
 			throw CreateNIE ();
 		}
+
+		public virtual object[] GetCustomAttributes(bool inherit)
+		{
+			throw CreateNIE ();
+		}
+
+		public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) 
+		{
+			throw CreateNIE ();
+		}
 #endif
 
 	}

+ 20 - 0
mcs/class/corlib/System.Reflection/MonoModule.cs

@@ -67,5 +67,25 @@ namespace System.Reflection {
 					filtered.Add (t);
 			return (Type[])filtered.ToArray (typeof(Type));
 		}
+
+#if NET_4_0
+		public override
+#else
+		public virtual
+#endif
+		object[] GetCustomAttributes(bool inherit) 
+		{
+			return MonoCustomAttrs.GetCustomAttributes (this, inherit);
+		}
+
+#if NET_4_0
+		public override
+#else
+		public virtual
+#endif
+		object[] GetCustomAttributes(Type attributeType, bool inherit) 
+		{
+			return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
+		}
 	}
 }