Prechádzať zdrojové kódy

2004-09-25 Zoltan Varga <[email protected]>

	* Module.cs: Add new 2.0 GetMethods and GetFields methods.

svn path=/trunk/mcs/; revision=34399
Zoltan Varga 21 rokov pred
rodič
commit
35d89cef80

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

@@ -1,5 +1,7 @@
 2004-09-25  Zoltan Varga  <[email protected]>
 
+	* Module.cs: Add new 2.0 GetMethods and GetFields methods.
+
 	* ParameterInfo.cs: Add GetPseudoCustomAttributes () method.
 
 2004-09-24  Zoltan Varga  <[email protected]>

+ 17 - 0
mcs/class/corlib/System.Reflection/Module.cs

@@ -176,6 +176,23 @@ namespace System.Reflection {
 
 			return GetGlobalType ().GetMethods ();
 		}
+
+#if NET_2_0
+		public MethodInfo[] GetMethods (BindingFlags flags) {
+			if (IsResource ())
+				return new MethodInfo [0];
+
+			return GetGlobalType ().GetMethods (flags);
+		}
+
+		public FieldInfo[] GetFields (BindingFlags flags) 
+		{
+			if (IsResource ())
+				return new FieldInfo [0];
+
+			return GetGlobalType ().GetFields (flags);
+		}
+#endif
 	
 		public virtual void GetObjectData (SerializationInfo info, StreamingContext context) 
 		{