2010-06-21 Jb Evain <jbevain@novell.com>
authorJb Evain <jbevain@gmail.com>
Mon, 21 Jun 2010 13:25:24 +0000 (13:25 -0000)
committerJb Evain <jbevain@gmail.com>
Mon, 21 Jun 2010 13:25:24 +0000 (13:25 -0000)
* MonoModule.cs
* Assembly.cs
* MonoAssembly.cs
* Module.cs:
Make Assembly and Module abstract on Moonlight too.

svn path=/trunk/mcs/; revision=159266

mcs/class/corlib/System.Reflection/Assembly.cs
mcs/class/corlib/System.Reflection/ChangeLog
mcs/class/corlib/System.Reflection/Module.cs
mcs/class/corlib/System.Reflection/MonoAssembly.cs
mcs/class/corlib/System.Reflection/MonoModule.cs

index 9051de7de7d5414599f25a8b1712e5153090516b..3898bf7ed50e0b601757c711742a01378a1b80a2 100644 (file)
@@ -51,8 +51,10 @@ namespace System.Reflection {
        [ComDefaultInterfaceAttribute (typeof (_Assembly))]
        [Serializable]
        [ClassInterface(ClassInterfaceType.None)]
-#if NET_2_1
+#if MONOTOUCH
        public partial class Assembly : ICustomAttributeProvider, _Assembly {
+#elif MOONLIGHT
+       public abstract class Assembly : ICustomAttributeProvider, _Assembly {
 #elif NET_4_0
        public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
 #else
@@ -77,7 +79,7 @@ namespace System.Reflection {
                private bool fromByteArray;
                private string assemblyName;
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                protected
 #else
                internal
@@ -611,7 +613,7 @@ namespace System.Reflection {
 
                [MonoTODO ("Not implemented")]
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                virtual
 #endif
                Module LoadModule (string moduleName, byte [] rawModule, byte [] rawSymbolStore)
@@ -668,7 +670,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                virtual
 #endif
                Object CreateInstance (String typeName, Boolean ignoreCase,
@@ -758,7 +760,7 @@ namespace System.Reflection {
                [MonoTODO ("Currently it always returns zero")]
                [ComVisible (false)]
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                virtual
 #endif
                long HostContext {
@@ -792,10 +794,11 @@ namespace System.Reflection {
                }
                
 #if NET_4_0
+#if MOONLIGHT
                public virtual IList<CustomAttributeData> GetCustomAttributesData () {
                        return CustomAttributeData.GetCustomAttributes (this);
                }
-
+#endif
                public PermissionSet PermissionSet {
                        get { return this.GrantedPermissionSet; }
                }
@@ -884,7 +887,7 @@ namespace System.Reflection {
                }
 #endif
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                static Exception CreateNIE ()
                {
                        return new NotImplementedException ("Derived classes must implement it");
index 5c31e92642b75b7402e6ea27c0f88de52b561f2a..40855c8af183b11224dbc8e456d0b60d4abc3a42 100644 (file)
@@ -1,3 +1,11 @@
+2010-06-21  Jb Evain  <jbevain@novell.com>
+
+       * MonoModule.cs
+       * Assembly.cs
+       * MonoAssembly.cs
+       * Module.cs:
+               Make Assembly and Module abstract on Moonlight too.
+
 2010-06-03  Jb Evain  <jbevain@novell.com>
 
        * Assembly.cs: add net_4_0's PermissionSet property.
index 428c3c319c9477f5320e85d94f8aca1c55a31e57..c18a43de49a04822f91029ebe94c6d539ba6b3e2 100644 (file)
@@ -48,7 +48,7 @@ namespace System.Reflection {
        [Serializable]
        [ClassInterfaceAttribute (ClassInterfaceType.None)]
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
        public abstract class Module : ISerializable, ICustomAttributeProvider, _Module {
 #else
        public partial class Module : ISerializable, ICustomAttributeProvider, _Module {
@@ -75,7 +75,7 @@ namespace System.Reflection {
                }
 
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                protected
 #else
                internal
@@ -290,7 +290,7 @@ namespace System.Reflection {
                        throw new NotImplementedException ();
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
 
                public virtual Assembly Assembly {
                        get { throw CreateNIE (); }
index 79377cec2310d2bd1d8684cb5e6d655dda266256..938a4de1a11ea005ae81f040268d95b1297c0cdc 100644 (file)
@@ -35,7 +35,7 @@ using System.Reflection.Emit;
 
 namespace System.Reflection {
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
        [ComVisible (true)]
        [ComDefaultInterfaceAttribute (typeof (_Assembly))]
        [Serializable]
@@ -45,7 +45,7 @@ namespace System.Reflection {
        public partial class Assembly {
 #endif
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Type GetType (string name, bool throwOnError, bool ignoreCase)
@@ -57,7 +57,7 @@ namespace System.Reflection {
                        throw new ArgumentException ("name", "Name cannot be empty");
 
                        res = InternalGetType (null, name, throwOnError, ignoreCase);
-#if !NET_4_0
+#if !(NET_4_0 || MOONLIGHT)
                        if (res is TypeBuilder) {
                                if (throwOnError)
                                        throw new TypeLoadException (string.Format ("Could not load type '{0}' from assembly '{1}'", name, this));
@@ -68,7 +68,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Module GetModule (String name)
@@ -88,7 +88,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                AssemblyName[] GetReferencedAssemblies () {
@@ -96,7 +96,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Module[] GetModules (bool getResourceModules) {
@@ -115,7 +115,7 @@ namespace System.Reflection {
 
                [MonoTODO ("Always returns the same as GetModules")]
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Module[] GetLoadedModules (bool getResourceModules)
@@ -124,7 +124,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Assembly GetSatelliteAssembly (CultureInfo culture)
@@ -133,7 +133,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
@@ -144,7 +144,7 @@ namespace System.Reflection {
                //FIXME remove GetManifestModule under v4, it's a v2 artifact
                [ComVisible (false)]
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Module ManifestModule {
index 90b13cfda018aad6c6ce5a9f2addb4d225d714ef..6982f6a5422add4711168405e99310dc39d78874 100644 (file)
@@ -38,7 +38,7 @@ using System.Security.Permissions;
 
 namespace System.Reflection {
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
        [ComVisible (true)]
        [ComDefaultInterfaceAttribute (typeof (_Module))]
        [Serializable]
@@ -49,7 +49,7 @@ namespace System.Reflection {
 #endif
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Assembly Assembly {
@@ -57,7 +57,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                // Note: we do not ask for PathDiscovery because no path is returned here.
@@ -67,7 +67,7 @@ namespace System.Reflection {
                }
        
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                string ScopeName {
@@ -75,7 +75,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                int MDStreamVersion {
@@ -87,7 +87,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Guid ModuleVersionId {
@@ -96,7 +96,7 @@ namespace System.Reflection {
                        }
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -113,7 +113,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                bool IsResource()
@@ -121,7 +121,7 @@ namespace System.Reflection {
                        return is_resource;
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -136,7 +136,7 @@ namespace System.Reflection {
                        return (Type[])filtered.ToArray (typeof(Type));
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -146,7 +146,7 @@ namespace System.Reflection {
                        return MonoCustomAttrs.GetCustomAttributes (this, inherit);
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -156,7 +156,7 @@ namespace System.Reflection {
                        return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -170,7 +170,7 @@ namespace System.Reflection {
                        return (globalType != null) ? globalType.GetField (name, bindingAttr) : null;
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -184,7 +184,7 @@ namespace System.Reflection {
                        return (globalType != null) ? globalType.GetFields (bindingFlags) : new FieldInfo [0];
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -193,7 +193,7 @@ namespace System.Reflection {
                        get { return get_MetadataToken (this); }
                }
                protected
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #else
                virtual
@@ -212,7 +212,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                MethodInfo[] GetMethods (BindingFlags bindingFlags) {
@@ -223,7 +223,7 @@ namespace System.Reflection {
                        return (globalType != null) ? globalType.GetMethods (bindingFlags) : new MethodInfo [0];
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -232,7 +232,7 @@ namespace System.Reflection {
                        ModuleHandle.GetPEKind (out peKind, out machine);
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -246,7 +246,7 @@ namespace System.Reflection {
                        return assembly.InternalGetType (this, className, throwOnError, ignoreCase);
                }
        
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -257,7 +257,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                FieldInfo ResolveField (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -271,7 +271,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                MemberInfo ResolveMember (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -286,7 +286,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                MethodBase ResolveMethod (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -300,7 +300,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                string ResolveString (int metadataToken) {
@@ -314,7 +314,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                Type ResolveType (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
@@ -328,7 +328,7 @@ namespace System.Reflection {
                }
 
                public
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                override
 #endif
                byte[] ResolveSignature (int metadataToken) {
@@ -358,7 +358,7 @@ namespace System.Reflection {
                }
 #endif
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override
 #else
                public virtual
@@ -368,7 +368,7 @@ namespace System.Reflection {
                        return InternalGetTypes ();
                }
 
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
                public override IList<CustomAttributeData> GetCustomAttributesData () {
                        return CustomAttributeData.GetCustomAttributes (this);
                }