Merge pull request #735 from wtfrank/bitblt
[mono.git] / mcs / class / corlib / System.Reflection / PropertyInfo.cs
index 10e97282cc53c4304cf8b1558590f204c7a80b80..6675d2e6c69f7bdbbf18d71b2393815e6458b947 100644 (file)
@@ -38,11 +38,24 @@ namespace System.Reflection {
        [ComDefaultInterfaceAttribute (typeof (_PropertyInfo))]
        [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;}
@@ -70,13 +83,6 @@ namespace System.Reflection {
                
                public abstract ParameterInfo[] GetIndexParameters();
 
-#if ONLY_1_1
-               public new Type GetType ()
-               {
-                       return base.GetType ();
-               }
-#endif
-
                public MethodInfo GetSetMethod()
                {
                        return GetSetMethod (false);
@@ -90,7 +96,16 @@ namespace System.Reflection {
                {
                        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]
@@ -99,7 +114,16 @@ namespace System.Reflection {
                {
                        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);
 
                public virtual Type[] GetOptionalCustomModifiers () {
@@ -110,7 +134,8 @@ namespace System.Reflection {
                        return Type.EmptyTypes;
                }
 
-               NotImplementedException CreateNIE () {
+               static NotImplementedException CreateNIE ()
+               {
                        return new NotImplementedException ();
                }
 
@@ -125,7 +150,7 @@ namespace System.Reflection {
 #if NET_4_0
                public override bool Equals (object obj)
                {
-                       return obj == this;
+                       return obj == (object) this;
                }
 
                public override int GetHashCode ()
@@ -152,11 +177,18 @@ namespace System.Reflection {
                }
 #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 ();
@@ -171,5 +203,6 @@ namespace System.Reflection {
                {
                        throw new NotImplementedException ();
                }
+#endif
        }
 }