//
// (C) Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// 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;
[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;}
public abstract void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture);
-#if ONLY_1_1
- public new Type GetType ()
- {
- return base.GetType ();
- }
-#endif
-
[DebuggerHidden]
[DebuggerStepThrough]
public void SetValue (object obj, object value)
}
[CLSCompliant(false)]
- [MonoTODO("Not implemented")]
public virtual object GetValueDirect (TypedReference obj)
{
- throw new NotImplementedException ();
+ throw new NotSupportedException(Environment.GetResourceString("NotSupported_AbstractNonCLS"));
}
[CLSCompliant(false)]
- [MonoTODO("Not implemented")]
public virtual void SetValueDirect (TypedReference obj, object value)
{
- throw new NotImplementedException ();
+ throw new NotSupportedException(Environment.GetResourceString("NotSupported_AbstractNonCLS"));
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern UnmanagedMarshal GetUnmanagedMarshal ();
-
- internal virtual UnmanagedMarshal UMarshal {
- get {
- return GetUnmanagedMarshal ();
- }
- }
+ private extern MarshalAsAttribute get_marshal_info ();
internal object[] GetPseudoCustomAttributes ()
{
if (DeclaringType.IsExplicitLayout)
count ++;
- UnmanagedMarshal marshalAs = UMarshal;
+ MarshalAsAttribute marshalAs = get_marshal_info ();
if (marshalAs != null)
count ++;
if (DeclaringType.IsExplicitLayout)
attrs [count ++] = new FieldOffsetAttribute (GetFieldOffset ());
if (marshalAs != null)
- attrs [count ++] = marshalAs.ToMarshalAsAttribute ();
+ attrs [count ++] = marshalAs;
return attrs;
}
}
-#if NET_4_0
public override bool Equals (object obj)
{
- return obj == this;
+ return obj == (object) this;
}
public override int GetHashCode ()
return true;
return !left.Equals (right);
}
-#endif
+
+ public virtual bool IsSecurityCritical {
+ get {
+ throw new NotSupportedException ();
+ }
+ }
+
+ public virtual bool IsSecuritySafeCritical {
+ get {
+ throw new NotSupportedException ();
+ }
+ }
+
+ public virtual bool IsSecurityTransparent {
+ get {
+ throw new NotSupportedException ();
+ }
+ }
+
+#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 ();
{
throw new NotImplementedException ();
}
+#endif
}
}