System.Reflection.MemberInfo.GetCustomAttributes C# (CSharp) Method

GetCustomAttributes() public abstract method

public abstract GetCustomAttributes ( Type attributeType, bool inherit ) : Object[]
attributeType Type
inherit bool
return Object[]
        public abstract Object[] GetCustomAttributes(Type attributeType, bool inherit);

Same methods

MemberInfo::GetCustomAttributes ( bool inherit ) : Object[]

Usage Example

Beispiel #1
0
 public static AttributeMap[] Create(TypeModel model, MemberInfo member, bool inherit)
 {
     #if FEAT_IKVM
     System.Collections.Generic.IList<CustomAttributeData> all = member.__GetCustomAttributes(model.MapType(typeof(Attribute)), inherit);
     AttributeMap[] result = new AttributeMap[all.Count];
     int index = 0;
     foreach (CustomAttributeData attrib in all)
     {
         result[index++] = new AttributeDataMap(attrib);
     }
     return result;
     #else
     #if WINRT
     Attribute[] all = System.Linq.Enumerable.ToArray(member.GetCustomAttributes(inherit));
     #else
     var all = member.GetCustomAttributes(inherit);
     #endif
     var result = new AttributeMap[all.Length];
     for (var i = 0; i < all.Length; i++)
     {
         result[i] = new ReflectionAttributeMap((Attribute) all[i]);
     }
     return result;
     #endif
 }
All Usage Examples Of System.Reflection.MemberInfo::GetCustomAttributes