mscorlib(4.0.0.0) API with additions
CustomAttributeExtensions.cs
2 
3 namespace System.Reflection
4 {
6  [__DynamicallyInvokable]
7  public static class CustomAttributeExtensions
8  {
19  [__DynamicallyInvokable]
20  public static Attribute GetCustomAttribute(this Assembly element, Type attributeType)
21  {
22  return Attribute.GetCustomAttribute(element, attributeType);
23  }
24 
34  [__DynamicallyInvokable]
35  public static Attribute GetCustomAttribute(this Module element, Type attributeType)
36  {
37  return Attribute.GetCustomAttribute(element, attributeType);
38  }
39 
52  [__DynamicallyInvokable]
53  public static Attribute GetCustomAttribute(this MemberInfo element, Type attributeType)
54  {
55  return Attribute.GetCustomAttribute(element, attributeType);
56  }
57 
68  [__DynamicallyInvokable]
69  public static Attribute GetCustomAttribute(this ParameterInfo element, Type attributeType)
70  {
71  return Attribute.GetCustomAttribute(element, attributeType);
72  }
73 
81  [__DynamicallyInvokable]
82  public static T GetCustomAttribute<T>(this Assembly element) where T : Attribute
83  {
84  return (T)element.GetCustomAttribute(typeof(T));
85  }
86 
94  [__DynamicallyInvokable]
95  public static T GetCustomAttribute<T>(this Module element) where T : Attribute
96  {
97  return (T)element.GetCustomAttribute(typeof(T));
98  }
99 
110  [__DynamicallyInvokable]
111  public static T GetCustomAttribute<T>(this MemberInfo element) where T : Attribute
112  {
113  return (T)element.GetCustomAttribute(typeof(T));
114  }
115 
126  [__DynamicallyInvokable]
127  public static T GetCustomAttribute<T>(this ParameterInfo element) where T : Attribute
128  {
129  return (T)element.GetCustomAttribute(typeof(T));
130  }
131 
146  [__DynamicallyInvokable]
147  public static Attribute GetCustomAttribute(this MemberInfo element, Type attributeType, bool inherit)
148  {
149  return Attribute.GetCustomAttribute(element, attributeType, inherit);
150  }
151 
164  [__DynamicallyInvokable]
165  public static Attribute GetCustomAttribute(this ParameterInfo element, Type attributeType, bool inherit)
166  {
167  return Attribute.GetCustomAttribute(element, attributeType, inherit);
168  }
169 
182  [__DynamicallyInvokable]
183  public static T GetCustomAttribute<T>(this MemberInfo element, bool inherit) where T : Attribute
184  {
185  return (T)element.GetCustomAttribute(typeof(T), inherit);
186  }
187 
200  [__DynamicallyInvokable]
201  public static T GetCustomAttribute<T>(this ParameterInfo element, bool inherit) where T : Attribute
202  {
203  return (T)element.GetCustomAttribute(typeof(T), inherit);
204  }
205 
211  [__DynamicallyInvokable]
213  {
214  return Attribute.GetCustomAttributes(element);
215  }
216 
222  [__DynamicallyInvokable]
224  {
225  return Attribute.GetCustomAttributes(element);
226  }
227 
236  [__DynamicallyInvokable]
238  {
239  return Attribute.GetCustomAttributes(element);
240  }
241 
250  [__DynamicallyInvokable]
252  {
253  return Attribute.GetCustomAttributes(element);
254  }
255 
266  [__DynamicallyInvokable]
267  public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, bool inherit)
268  {
269  return Attribute.GetCustomAttributes(element, inherit);
270  }
271 
282  [__DynamicallyInvokable]
283  public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, bool inherit)
284  {
285  return Attribute.GetCustomAttributes(element, inherit);
286  }
287 
296  [__DynamicallyInvokable]
297  public static IEnumerable<Attribute> GetCustomAttributes(this Assembly element, Type attributeType)
298  {
299  return Attribute.GetCustomAttributes(element, attributeType);
300  }
301 
310  [__DynamicallyInvokable]
311  public static IEnumerable<Attribute> GetCustomAttributes(this Module element, Type attributeType)
312  {
313  return Attribute.GetCustomAttributes(element, attributeType);
314  }
315 
327  [__DynamicallyInvokable]
328  public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType)
329  {
330  return Attribute.GetCustomAttributes(element, attributeType);
331  }
332 
344  [__DynamicallyInvokable]
345  public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType)
346  {
347  return Attribute.GetCustomAttributes(element, attributeType);
348  }
349 
356  [__DynamicallyInvokable]
357  public static IEnumerable<T> GetCustomAttributes<T>(this Assembly element) where T : Attribute
358  {
359  return (IEnumerable<T>)GetCustomAttributes(element, typeof(T));
360  }
361 
368  [__DynamicallyInvokable]
369  public static IEnumerable<T> GetCustomAttributes<T>(this Module element) where T : Attribute
370  {
371  return (IEnumerable<T>)GetCustomAttributes(element, typeof(T));
372  }
373 
383  [__DynamicallyInvokable]
384  public static IEnumerable<T> GetCustomAttributes<T>(this MemberInfo element) where T : Attribute
385  {
386  return (IEnumerable<T>)GetCustomAttributes(element, typeof(T));
387  }
388 
398  [__DynamicallyInvokable]
399  public static IEnumerable<T> GetCustomAttributes<T>(this ParameterInfo element) where T : Attribute
400  {
401  return (IEnumerable<T>)GetCustomAttributes(element, typeof(T));
402  }
403 
417  [__DynamicallyInvokable]
418  public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType, bool inherit)
419  {
420  return Attribute.GetCustomAttributes(element, attributeType, inherit);
421  }
422 
436  [__DynamicallyInvokable]
437  public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType, bool inherit)
438  {
439  return Attribute.GetCustomAttributes(element, attributeType, inherit);
440  }
441 
453  [__DynamicallyInvokable]
454  public static IEnumerable<T> GetCustomAttributes<T>(this MemberInfo element, bool inherit) where T : Attribute
455  {
456  return (IEnumerable<T>)GetCustomAttributes(element, typeof(T), inherit);
457  }
458 
470  [__DynamicallyInvokable]
471  public static IEnumerable<T> GetCustomAttributes<T>(this ParameterInfo element, bool inherit) where T : Attribute
472  {
473  return (IEnumerable<T>)GetCustomAttributes(element, typeof(T), inherit);
474  }
475 
485  [__DynamicallyInvokable]
486  public static bool IsDefined(this Assembly element, Type attributeType)
487  {
488  return Attribute.IsDefined(element, attributeType);
489  }
490 
500  [__DynamicallyInvokable]
501  public static bool IsDefined(this Module element, Type attributeType)
502  {
503  return Attribute.IsDefined(element, attributeType);
504  }
505 
517  [__DynamicallyInvokable]
518  public static bool IsDefined(this MemberInfo element, Type attributeType)
519  {
520  return Attribute.IsDefined(element, attributeType);
521  }
522 
532  [__DynamicallyInvokable]
533  public static bool IsDefined(this ParameterInfo element, Type attributeType)
534  {
535  return Attribute.IsDefined(element, attributeType);
536  }
537 
551  [__DynamicallyInvokable]
552  public static bool IsDefined(this MemberInfo element, Type attributeType, bool inherit)
553  {
554  return Attribute.IsDefined(element, attributeType, inherit);
555  }
556 
568  [__DynamicallyInvokable]
569  public static bool IsDefined(this ParameterInfo element, Type attributeType, bool inherit)
570  {
571  return Attribute.IsDefined(element, attributeType, inherit);
572  }
573  }
574 }
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
Discovers the attributes of a parameter and provides access to parameter metadata.
static Attribute GetCustomAttribute(this MemberInfo element, Type attributeType, bool inherit)
Retrieves a custom attribute of a specified type that is applied to a specified member,...
Contains static methods for retrieving custom attributes.
static Attribute GetCustomAttribute(this Module element, Type attributeType)
Retrieves a custom attribute of a specified type that is applied to a specified module.
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element, Type attributeType, bool inherit)
Retrieves a collection of custom attributes of a specified type that are applied to a specified membe...
Represents the base class for custom attributes.
Definition: Attribute.cs:15
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element)
Retrieves a collection of custom attributes that are applied to a specified parameter.
Definition: __Canon.cs:3
static bool IsDefined(this Assembly element, Type attributeType)
Indicates whether custom attributes of a specified type are applied to a specified assembly.
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element, Type attributeType, bool inherit)
Retrieves a collection of custom attributes of a specified type that are applied to a specified param...
static IEnumerable< Attribute > GetCustomAttributes(this Module element)
Retrieves a collection of custom attributes that are applied to a specified module.
static Attribute GetCustomAttribute(this Assembly element, Type attributeType)
Retrieves a custom attribute of a specified type that is applied to a specified assembly.
static T GetCustomAttribute< T >(this Assembly element)
Retrieves a custom attribute of a specified type that is applied to a specified assembly.
static IEnumerable< Attribute > GetCustomAttributes(this Module element, Type attributeType)
Retrieves a collection of custom attributes of a specified type that are applied to a specified modul...
Exposes the enumerator, which supports a simple iteration over a collection of a specified type....
Definition: IEnumerable.cs:9
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element)
Retrieves a collection of custom attributes that are applied to a specified member.
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element, bool inherit)
Retrieves a collection of custom attributes that are applied to a specified parameter,...
static bool IsDefined(this ParameterInfo element, Type attributeType)
Indicates whether custom attributes of a specified type are applied to a specified parameter.
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element, Type attributeType)
Retrieves a collection of custom attributes of a specified type that are applied to a specified param...
Represents an assembly, which is a reusable, versionable, and self-describing building block of a com...
Definition: Assembly.cs:22
static bool IsDefined(this MemberInfo element, Type attributeType)
Indicates whether custom attributes of a specified type are applied to a specified member.
static IEnumerable< T > GetCustomAttributes< T >(this Assembly element)
Retrieves a collection of custom attributes of a specified type that are applied to a specified assem...
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
static Attribute GetCustomAttribute(this MemberInfo element, Type attributeType)
Retrieves a custom attribute of a specified type that is applied to a specified member.
static bool IsDefined(this Module element, Type attributeType)
Indicates whether custom attributes of a specified type are applied to a specified module.
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element, Type attributeType)
Retrieves a collection of custom attributes of a specified type that are applied to a specified membe...
static Attribute [] GetCustomAttributes(MemberInfo element, Type type)
Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the mem...
Definition: Attribute.cs:346
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element, bool inherit)
Retrieves a collection of custom attributes that are applied to a specified member,...
static Attribute GetCustomAttribute(this ParameterInfo element, Type attributeType)
Retrieves a custom attribute of a specified type that is applied to a specified parameter.
static Attribute GetCustomAttribute(this ParameterInfo element, Type attributeType, bool inherit)
Retrieves a custom attribute of a specified type that is applied to a specified parameter,...
static bool IsDefined(this MemberInfo element, Type attributeType, bool inherit)
Indicates whether custom attributes of a specified type are applied to a specified member,...
static bool IsDefined(this ParameterInfo element, Type attributeType, bool inherit)
Indicates whether custom attributes of a specified type are applied to a specified parameter,...
static bool IsDefined(MemberInfo element, Type attributeType)
Determines whether any custom attributes are applied to a member of a type. Parameters specify the me...
Definition: Attribute.cs:442
static Attribute GetCustomAttribute(MemberInfo element, Type attributeType)
Retrieves a custom attribute applied to a member of a type. Parameters specify the member,...
Definition: Attribute.cs:498
static IEnumerable< Attribute > GetCustomAttributes(this Assembly element)
Retrieves a collection of custom attributes that are applied to a specified assembly.
static IEnumerable< Attribute > GetCustomAttributes(this Assembly element, Type attributeType)
Retrieves a collection of custom attributes of a specified type that are applied to a specified assem...