using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
namespace System.Reflection {
-#if NET_2_0
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_PropertyInfo))]
-#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
+#if MOBILE
+ public abstract class PropertyInfo : MemberInfo {
+#else
public abstract class PropertyInfo : MemberInfo, _PropertyInfo {
-
+#endif
public abstract PropertyAttributes Attributes { get; }
public abstract bool CanRead { get; }
public abstract bool CanWrite { get; }
+
+#if NET_4_5
+ public virtual MethodInfo GetMethod {
+ get { return GetGetMethod(true); }
+ }
+
+ public virtual MethodInfo SetMethod {
+ get { return GetSetMethod(true); }
+ }
+#endif
public bool IsSpecialName {
get {return (Attributes & PropertyAttributes.SpecialName) != 0;}
public abstract ParameterInfo[] GetIndexParameters();
-#if ONLY_1_1
- public new Type GetType ()
- {
- return base.GetType ();
- }
-#endif
-
public MethodInfo GetSetMethod()
{
return GetSetMethod (false);
{
return GetValue(obj, BindingFlags.Default, null, index, null);
}
-
+
+#if NET_4_5
+ [DebuggerHidden]
+ [DebuggerStepThrough]
+ public object GetValue (object obj)
+ {
+ return GetValue(obj, BindingFlags.Default, null, null, null);
+ }
+#endif
+
public abstract object GetValue (object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
[DebuggerHidden]
{
SetValue (obj, value, BindingFlags.Default, null, index, null);
}
-
+
+#if NET_4_5
+ [DebuggerHidden]
+ [DebuggerStepThrough]
+ public void SetValue (object obj, object value)
+ {
+ SetValue (obj, value, BindingFlags.Default, null, null, null);
+ }
+#endif
+
public abstract void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
-#if NET_2_0 || BOOTSTRAP_NET_2_0
- [MonoTODO]
public virtual Type[] GetOptionalCustomModifiers () {
- throw new NotImplementedException ();
+ return Type.EmptyTypes;
}
- [MonoTODO]
public virtual Type[] GetRequiredCustomModifiers () {
- throw new NotImplementedException ();
+ return Type.EmptyTypes;
+ }
+
+ static NotImplementedException CreateNIE ()
+ {
+ return new NotImplementedException ();
}
- [MonoTODO]
public virtual object GetConstantValue () {
- throw new NotImplementedException ();
+ throw CreateNIE ();
}
- [MonoTODO]
public virtual object GetRawConstantValue() {
- throw new NotImplementedException ();
+ throw CreateNIE ();
+ }
+
+#if NET_4_0
+ public override bool Equals (object obj)
+ {
+ return obj == (object) this;
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ public static bool operator == (PropertyInfo left, PropertyInfo right)
+ {
+ if ((object)left == (object)right)
+ return true;
+ if ((object)left == null ^ (object)right == null)
+ return false;
+ return left.Equals (right);
+ }
+
+ public static bool operator != (PropertyInfo left, PropertyInfo right)
+ {
+ if ((object)left == (object)right)
+ return false;
+ if ((object)left == null ^ (object)right == null)
+ return true;
+ return !left.Equals (right);
}
#endif
+#if !MOBILE
void _PropertyInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException ();
}
+ Type _PropertyInfo.GetType ()
+ {
+ // Required or object::GetType becomes virtual final
+ return base.GetType ();
+ }
+
void _PropertyInfo.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException ();
{
throw new NotImplementedException ();
}
+#endif
}
}