mscorlib(4.0.0.0) API with additions
MemberInfo.cs
4 
5 namespace System.Reflection
6 {
9  [ClassInterface(ClassInterfaceType.None)]
10  [ComDefaultInterface(typeof(_MemberInfo))]
11  [ComVisible(true)]
12  [__DynamicallyInvokable]
13  [PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
15  {
18  public abstract MemberTypes MemberType
19  {
20  get;
21  }
22 
25  [__DynamicallyInvokable]
26  public abstract string Name
27  {
28  [__DynamicallyInvokable]
29  get;
30  }
31 
34  [__DynamicallyInvokable]
35  public abstract Type DeclaringType
36  {
37  [__DynamicallyInvokable]
38  get;
39  }
40 
43  [__DynamicallyInvokable]
44  public abstract Type ReflectedType
45  {
46  [__DynamicallyInvokable]
47  get;
48  }
49 
52  [__DynamicallyInvokable]
54  {
55  [__DynamicallyInvokable]
56  get
57  {
58  return GetCustomAttributesData();
59  }
60  }
61 
65  public virtual int MetadataToken
66  {
67  get
68  {
69  throw new InvalidOperationException();
70  }
71  }
72 
76  [__DynamicallyInvokable]
77  public virtual Module Module
78  {
79  [__DynamicallyInvokable]
80  get
81  {
82  if (this is Type)
83  {
84  return ((Type)this).Module;
85  }
86  throw new NotImplementedException();
87  }
88  }
89 
90  internal virtual bool CacheEquals(object o)
91  {
92  throw new NotImplementedException();
93  }
94 
101  [__DynamicallyInvokable]
102  public abstract object[] GetCustomAttributes(bool inherit);
103 
112  [__DynamicallyInvokable]
113  public abstract object[] GetCustomAttributes(Type attributeType, bool inherit);
114 
121  [__DynamicallyInvokable]
122  public abstract bool IsDefined(Type attributeType, bool inherit);
123 
127  {
128  throw new NotImplementedException();
129  }
130 
136  [__DynamicallyInvokable]
137  public static bool operator ==(MemberInfo left, MemberInfo right)
138  {
139  if ((object)left == right)
140  {
141  return true;
142  }
143  if ((object)left == null || (object)right == null)
144  {
145  return false;
146  }
147  Type left2;
148  Type right2;
149  if ((left2 = (left as Type)) != null && (right2 = (right as Type)) != null)
150  {
151  return left2 == right2;
152  }
153  MethodBase left3;
154  MethodBase right3;
155  if ((left3 = (left as MethodBase)) != null && (right3 = (right as MethodBase)) != null)
156  {
157  return left3 == right3;
158  }
159  FieldInfo left4;
160  FieldInfo right4;
161  if ((left4 = (left as FieldInfo)) != null && (right4 = (right as FieldInfo)) != null)
162  {
163  return left4 == right4;
164  }
165  EventInfo left5;
166  EventInfo right5;
167  if ((left5 = (left as EventInfo)) != null && (right5 = (right as EventInfo)) != null)
168  {
169  return left5 == right5;
170  }
171  PropertyInfo left6;
172  PropertyInfo right6;
173  if ((left6 = (left as PropertyInfo)) != null && (right6 = (right as PropertyInfo)) != null)
174  {
175  return left6 == right6;
176  }
177  return false;
178  }
179 
185  [__DynamicallyInvokable]
186  public static bool operator !=(MemberInfo left, MemberInfo right)
187  {
188  return !(left == right);
189  }
190 
195  [__DynamicallyInvokable]
196  public override bool Equals(object obj)
197  {
198  return base.Equals(obj);
199  }
200 
203  [__DynamicallyInvokable]
204  public override int GetHashCode()
205  {
206  return base.GetHashCode();
207  }
208 
212  {
213  return GetType();
214  }
215 
219  void _MemberInfo.GetTypeInfoCount(out uint pcTInfo)
220  {
221  throw new NotImplementedException();
222  }
223 
229  void _MemberInfo.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
230  {
231  throw new NotImplementedException();
232  }
233 
241  void _MemberInfo.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
242  {
243  throw new NotImplementedException();
244  }
245 
256  void _MemberInfo.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
257  {
258  throw new NotImplementedException();
259  }
260  }
261 }
Obtains information about the attributes of a member and provides access to member metadata.
Definition: MemberInfo.cs:14
Performs reflection on a module.
Definition: Module.cs:17
abstract Type DeclaringType
Gets the class that declares this member.
Definition: MemberInfo.cs:36
static bool operator !=(MemberInfo left, MemberInfo right)
Indicates whether two T:System.Reflection.MemberInfo objects are not equal.
Definition: MemberInfo.cs:186
Discovers the attributes of a field and provides access to field metadata.
Definition: FieldInfo.cs:15
Definition: __Canon.cs:3
abstract object [] GetCustomAttributes(bool inherit)
When overridden in a derived class, returns an array of all custom attributes applied to this member.
Exposes the enumerator, which supports a simple iteration over a collection of a specified type....
Definition: IEnumerable.cs:9
new Type GetType()
Provides COM objects with version-independent access to the M:System.Type.GetType method.
SecurityAction
Specifies the security actions that can be performed using declarative security.
abstract bool IsDefined(Type attributeType, bool inherit)
When overridden in a derived class, indicates whether one or more attributes of the specified type or...
void GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
Maps a set of names to a corresponding set of dispatch identifiers.
virtual IEnumerable< CustomAttributeData > CustomAttributes
Gets a collection that contains this member's custom attributes.
Definition: MemberInfo.cs:54
Discovers the attributes of an event and provides access to event metadata.
Definition: EventInfo.cs:15
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
Provides information about methods and constructors.
Definition: MethodBase.cs:19
abstract string Name
Gets the name of the current member.
Definition: MemberInfo.cs:27
static bool operator==(MemberInfo left, MemberInfo right)
Indicates whether two T:System.Reflection.MemberInfo objects are equal.
Definition: MemberInfo.cs:137
override int GetHashCode()
Returns the hash code for this instance.
Definition: MemberInfo.cs:204
Discovers the attributes of a property and provides access to property metadata.
Definition: PropertyInfo.cs:15
void Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
Provides access to properties and methods exposed by an object.
abstract Type ReflectedType
Gets the class object that was used to obtain this instance of MemberInfo.
Definition: MemberInfo.cs:45
Represents a collection of objects that can be individually accessed by index.
Definition: IList.cs:9
void GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
Retrieves the type information for an object, which can be used to get the type information for an in...
virtual IList< CustomAttributeData > GetCustomAttributesData()
Returns a list of T:System.Reflection.CustomAttributeData objects representing data about the attribu...
Definition: MemberInfo.cs:126
Specifies that the class can be serialized.
The exception that is thrown when a method call is invalid for the object's current state.
abstract MemberTypes MemberType
When overridden in a derived class, gets a T:System.Reflection.MemberTypes value indicating the type ...
Definition: MemberInfo.cs:19
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
Specifies that the parameter is an input parameter.
void GetTypeInfoCount(out uint pcTInfo)
Retrieves the number of type information interfaces that an object provides (either 0 or 1).
MemberTypes
Marks each type of member that is defined as a derived class of T:System.Reflection....
Definition: MemberTypes.cs:9
Exposes the public members of the T:System.Reflection.MemberInfo class to unmanaged code.
Definition: _MemberInfo.cs:11
The exception that is thrown when a requested method or operation is not implemented.
Provides custom attributes for reflection objects that support them.
virtual int MetadataToken
Gets a value that identifies a metadata element.
Definition: MemberInfo.cs:66
override bool Equals(object obj)
Returns a value that indicates whether this instance is equal to a specified object.
Definition: MemberInfo.cs:196