Selaa lähdekoodia

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

	* Module.cs:
	* MonoModule.cs: Implement GetSignerCertificate and
	GetTypes.

svn path=/trunk/mcs/; revision=154594
Rodrigo Kumpera 15 vuotta sitten
vanhempi
sitoutus
fef7a3d59e

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

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

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

@@ -170,18 +170,6 @@ namespace System.Reflection {
 			UnitySerializationHolder.GetModuleData (this, info, context);
 		}
 
-#if !NET_2_1
-		public X509Certificate GetSignerCertificate ()
-		{
-			try {
-				return X509Certificate.CreateFromSignedFile (assembly.Location);
-			}
-			catch {
-				return null;
-			}
-		}
-#endif
-
 		[ComVisible (true)]
 		public virtual Type GetType(string className) 
 		{
@@ -195,12 +183,7 @@ namespace System.Reflection {
 		}
 	
 		[MethodImplAttribute (MethodImplOptions.InternalCall)]
-		private extern Type[] InternalGetTypes ();
-	
-		public virtual Type[] GetTypes() 
-		{
-			return InternalGetTypes ();
-		}
+		internal extern Type[] InternalGetTypes ();
 	
 		public override string ToString () 
 		{
@@ -441,6 +424,16 @@ namespace System.Reflection {
 		{
 			throw CreateNIE ();
 		}
+
+		public virtual X509Certificate GetSignerCertificate ()
+		{
+			throw CreateNIE ();
+		}
+
+		public virtual Type[] GetTypes() 
+		{
+			throw CreateNIE ();
+		}
 #endif
 
 	}

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

@@ -31,6 +31,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Runtime.InteropServices;
+using System.Security.Cryptography.X509Certificates;
 
 
 namespace System.Reflection {
@@ -262,6 +263,33 @@ namespace System.Reflection {
 				return res;
 		}
 
+#if !NET_2_1
+
+		public
+#if NET_4_0
+		override
+#endif
+		X509Certificate GetSignerCertificate ()
+		{
+			try {
+				return X509Certificate.CreateFromSignedFile (assembly.Location);
+			}
+			catch {
+				return null;
+			}
+		}
+#endif
+
+#if NET_4_0
+		public override
+#else
+		public virtual
+#endif
+		Type[] GetTypes() 
+		{
+			return InternalGetTypes ();
+		}
+
 #if NET_4_0
 		public override IList<CustomAttributeData> GetCustomAttributesData () {
 			return CustomAttributeData.GetCustomAttributes (this);