// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// TODO: Mucho left to implement.
-//
-
using System.Diagnostics;
using System.Reflection.Emit;
using System.Globalization;
}
}
- public abstract void SetValue (object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture);
+ public abstract void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture);
#if ONLY_1_1
public new Type GetType ()
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern FieldInfo internal_from_handle (IntPtr handle);
+ private static extern FieldInfo internal_from_handle_type (IntPtr field_handle, IntPtr type_handle);
public static FieldInfo GetFieldFromHandle (RuntimeFieldHandle handle)
{
- return internal_from_handle (handle.Value);
+ if (handle.Value == IntPtr.Zero)
+ throw new ArgumentException ("The handle is invalid.");
+ return internal_from_handle_type (handle.Value, IntPtr.Zero);
}
+#if NET_2_0
+ [ComVisible (false)]
+ public static FieldInfo GetFieldFromHandle (RuntimeFieldHandle handle, RuntimeTypeHandle declaringType)
+ {
+ if (handle.Value == IntPtr.Zero)
+ throw new ArgumentException ("The handle is invalid.");
+ return internal_from_handle_type (handle.Value, declaringType.Value);
+ }
+#endif
+
//
// Note: making this abstract imposes an implementation requirement
// on any class that derives from it. However, since it's also
}
[CLSCompliant(false)]
- [MonoTODO]
+ [MonoTODO("Not implemented")]
public virtual object GetValueDirect (TypedReference obj)
{
throw new NotImplementedException ();
}
[CLSCompliant(false)]
- [MonoTODO]
+ [MonoTODO("Not implemented")]
public virtual void SetValueDirect (TypedReference obj, object value)
{
throw new NotImplementedException ();
}
#if NET_2_0 || BOOTSTRAP_NET_2_0
- [Obsolete ("Use FieldInfo.GetOptionalCustomModifiers().")]
- public virtual Type[] OptionalCustomModifiers {
- get {
- return GetOptionalCustomModifiers ();
- }
- }
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ extern Type[] GetTypeModifiers (bool optional);
- [Obsolete ("Use FieldInfo.GetRequiredCustomModifiers().")]
- public virtual Type[] RequiredCustomModifiers {
- get {
- return GetRequiredCustomModifiers ();
- }
- }
-
- [MonoTODO]
public virtual Type[] GetOptionalCustomModifiers () {
- throw new NotImplementedException ();
+ Type[] types = GetTypeModifiers (true);
+ if (types == null)
+ return Type.EmptyTypes;
+ return types;
}
- [MonoTODO]
public virtual Type[] GetRequiredCustomModifiers () {
- throw new NotImplementedException ();
+ Type[] types = GetTypeModifiers (false);
+ if (types == null)
+ return Type.EmptyTypes;
+ return types;
}
-#endif
-#if NET_2_0 || BOOTSTRAP_NET_2_0
- public abstract FieldInfo Mono_GetGenericFieldDefinition ();
+ public virtual object GetRawConstantValue ()
+ {
+ throw new NotSupportedException ("This non-CLS method is not implemented.");
+ }
#endif
void _FieldInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)