Mobile should not have the COM types set.
[mono.git] / mcs / class / corlib / System.Reflection / FieldInfo.cs
index aba3e99969e6cd28b797ca7a6e7f7f03199a5353..06ea3e8e70cd8c01e2d8475819928bceb9bdd9ac 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 using System.Diagnostics;
-using System.Reflection.Emit;
 using System.Globalization;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
@@ -39,8 +38,11 @@ namespace System.Reflection {
        [ComDefaultInterfaceAttribute (typeof (_FieldInfo))]
        [Serializable]
        [ClassInterface(ClassInterfaceType.None)]
+#if MOBILE
+       public abstract class FieldInfo : MemberInfo {
+#else
        public abstract class FieldInfo : MemberInfo, _FieldInfo {
-
+#endif
                public abstract FieldAttributes Attributes {get;}
                public abstract RuntimeFieldHandle FieldHandle {get;}
 
@@ -191,13 +193,7 @@ namespace System.Reflection {
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern UnmanagedMarshal GetUnmanagedMarshal ();
-
-               internal virtual UnmanagedMarshal UMarshal {
-                       get {
-                               return GetUnmanagedMarshal ();
-                       }
-               }
+               private extern MarshalAsAttribute get_marshal_info ();
 
                internal object[] GetPseudoCustomAttributes ()
                {
@@ -209,7 +205,7 @@ namespace System.Reflection {
                        if (DeclaringType.IsExplicitLayout)
                                count ++;
 
-                       UnmanagedMarshal marshalAs = UMarshal;
+                       MarshalAsAttribute marshalAs = get_marshal_info ();
                        if (marshalAs != null)
                                count ++;
 
@@ -223,7 +219,7 @@ namespace System.Reflection {
                        if (DeclaringType.IsExplicitLayout)
                                attrs [count ++] = new FieldOffsetAttribute (GetFieldOffset ());
                        if (marshalAs != null)
-                               attrs [count ++] = marshalAs.ToMarshalAsAttribute ();
+                               attrs [count ++] = marshalAs;
 
                        return attrs;
                }
@@ -298,11 +294,19 @@ namespace System.Reflection {
                        }
                }
 #endif
+
+#if !MOBILE
                void _FieldInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
                {
                        throw new NotImplementedException ();
                }
 
+               Type _FieldInfo.GetType ()
+               {
+                       // Required or object::GetType becomes virtual final
+                       return base.GetType ();
+               }
+
                void _FieldInfo.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
                {
                        throw new NotImplementedException ();
@@ -317,5 +321,6 @@ namespace System.Reflection {
                {
                        throw new NotImplementedException ();
                }
+#endif
        }
 }