using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Permissions;
+using System.Collections.Generic;
namespace System.Reflection {
-#if NET_2_0
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_MemberInfo))]
-#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
+#if MOBILE
+ public abstract class MemberInfo : ICustomAttributeProvider {
+#else
public abstract class MemberInfo : ICustomAttributeProvider, _MemberInfo {
+#endif
protected MemberInfo ()
{
get;
}
-#if NET_2_0 || BOOTSTRAP_NET_2_0
public virtual Module Module {
get {
return DeclaringType.Module;
}
}
-#endif
-
-#if ONLY_1_1
- public new Type GetType ()
- {
- return base.GetType ();
- }
-#endif
- public abstract bool IsDefined (Type attribute_type, bool inherit);
+ public abstract bool IsDefined (Type attributeType, bool inherit);
public abstract object [] GetCustomAttributes (bool inherit);
- public abstract object [] GetCustomAttributes (Type attribute_type, bool inherit);
+ public abstract object [] GetCustomAttributes (Type attributeType, bool inherit);
-#if NET_2_0 || BOOTSTRAP_NET_2_0
- public
-#else
- internal
-#endif
- virtual extern int MetadataToken {
+ public virtual extern int MetadataToken {
[MethodImplAttribute (MethodImplOptions.InternalCall)]
get;
}
+ public override bool Equals (object obj)
+ {
+ return obj == (object) this;
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ public static bool operator == (MemberInfo left, MemberInfo 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 != (MemberInfo left, MemberInfo right)
+ {
+ if ((object)left == (object)right)
+ return false;
+ if ((object)left == null ^ (object)right == null)
+ return true;
+ return !left.Equals (right);
+ }
+
+ public virtual IList<CustomAttributeData> GetCustomAttributesData () {
+ throw new NotImplementedException ();
+ }
+
+ public virtual IEnumerable<CustomAttributeData> CustomAttributes {
+ get { return GetCustomAttributesData (); }
+ }
+
+#if !MOBILE
void _MemberInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException ();
}
+ Type _MemberInfo.GetType ()
+ {
+ // Required or object::GetType becomes virtual final
+ return base.GetType ();
+ }
+
void _MemberInfo.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException ();
{
throw new NotImplementedException ();
}
+#endif
}
}