using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
+using System.Security.Cryptography.X509Certificates;
+using System.Security;
+using System.Security.Permissions;
namespace System.Reflection {
public partial class Module {
#endif
+ public
+#if NET_4_0
+ override
+#endif
+ Assembly Assembly {
+ get { return assembly; }
+ }
+
+ public
+#if NET_4_0
+ override
+#endif
+ // Note: we do not ask for PathDiscovery because no path is returned here.
+ // However MS Fx requires it (see FDBK23572 for details).
+ string Name {
+ get { return name; }
+ }
+
+ public
+#if NET_4_0
+ override
+#endif
+ string ScopeName {
+ get { return scopename; }
+ }
+
+ public
+#if NET_4_0
+ override
+#endif
+ int MDStreamVersion {
+ get {
+ if (_impl == IntPtr.Zero)
+ throw new NotSupportedException ();
+ return GetMDStreamVersion (_impl);
+ }
+ }
+
+ public
+#if NET_4_0
+ override
+#endif
+ Guid ModuleVersionId {
+ get {
+ return GetModuleVersionId ();
+ }
+ }
+
+#if NET_4_0
+ public override
+#else
+ public virtual
+#endif
+ string FullyQualifiedName {
+ get {
+#if !NET_2_1
+ if (SecurityManager.SecurityEnabled) {
+ new FileIOPermission (FileIOPermissionAccess.PathDiscovery, fqname).Demand ();
+ }
+#endif
+ return fqname;
+ }
+ }
+
public
#if NET_4_0
override
#endif
Type[] FindTypes(TypeFilter filter, object filterCriteria)
{
- System.Collections.ArrayList filtered = new System.Collections.ArrayList ();
+ var filtered = new List<Type> ();
Type[] types = GetTypes ();
foreach (Type t in types)
if (filter (t, filterCriteria))
filtered.Add (t);
- return (Type[])filtered.ToArray (typeof(Type));
+ return filtered.ToArray ();
}
#if NET_4_0
return (globalType != null) ? globalType.GetFields (bindingFlags) : new FieldInfo [0];
}
+#if NET_4_0
+ public override
+#else
+ public virtual
+#endif
+ int MetadataToken {
+ get { return get_MetadataToken (this); }
+ }
protected
#if NET_4_0
override
return null;
Type globalType = GetGlobalType ();
- return (globalType != null) ? globalType.GetMethod (name, bindingAttr, binder, callConvention, types, modifiers) : null;
+ if (globalType == null)
+ return null;
+ if (types == null)
+ return globalType.GetMethod (name);
+ return globalType.GetMethod (name, bindingAttr, binder, callConvention, types, modifiers);
}
public
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);