@@ -35,48 +35,28 @@ partial class Attribute
3535
3636 public static Attribute [ ] GetCustomAttributes ( Assembly element ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , true ) ;
3737 public static Attribute [ ] GetCustomAttributes ( Assembly element , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , inherit ) ;
38- public static Attribute [ ] GetCustomAttributes ( Assembly element , Type attributeType ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
39- public static Attribute [ ] GetCustomAttributes ( Assembly element , Type attributeType , bool inherit ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
38+ public static Attribute [ ] GetCustomAttributes ( Assembly element , Type attributeType ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
39+ public static Attribute [ ] GetCustomAttributes ( Assembly element , Type attributeType , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
4040 public static Attribute [ ] GetCustomAttributes ( MemberInfo element ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , true ) ;
4141 public static Attribute [ ] GetCustomAttributes ( MemberInfo element , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , inherit ) ;
42- public static Attribute [ ] GetCustomAttributes ( MemberInfo element , Type attributeType ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
43- public static Attribute [ ] GetCustomAttributes ( MemberInfo element , Type attributeType , bool inherit ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
42+ public static Attribute [ ] GetCustomAttributes ( MemberInfo element , Type attributeType ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
43+ public static Attribute [ ] GetCustomAttributes ( MemberInfo element , Type attributeType , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
4444 public static Attribute [ ] GetCustomAttributes ( Module element ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , true ) ;
4545 public static Attribute [ ] GetCustomAttributes ( Module element , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , inherit ) ;
46- public static Attribute [ ] GetCustomAttributes ( Module element , Type attributeType ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
47- public static Attribute [ ] GetCustomAttributes ( Module element , Type attributeType , bool inherit ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
46+ public static Attribute [ ] GetCustomAttributes ( Module element , Type attributeType ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
47+ public static Attribute [ ] GetCustomAttributes ( Module element , Type attributeType , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
4848 public static Attribute [ ] GetCustomAttributes ( ParameterInfo element ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , true ) ;
4949 public static Attribute [ ] GetCustomAttributes ( ParameterInfo element , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , inherit ) ;
50- public static Attribute [ ] GetCustomAttributes ( ParameterInfo element , Type attributeType ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
51- public static Attribute [ ] GetCustomAttributes ( ParameterInfo element , Type attributeType , bool inherit ) => ( Attribute [ ] ) GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
52-
53- internal static Attribute [ ] GetCustomAttributes ( ICustomAttributeProvider element , Type attributeType , bool inherit )
54- {
55- if ( attributeType == null )
56- throw new ArgumentNullException ( nameof ( attributeType ) ) ;
57- if ( ! attributeType . IsSubclassOf ( typeof ( Attribute ) ) && attributeType != typeof ( Attribute ) )
58- throw new ArgumentException ( SR . Argument_MustHaveAttributeBaseClass + " " + attributeType . FullName ) ;
59-
60- return ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( element , attributeType , inherit ) ;
61- }
62-
63- public static bool IsDefined ( Assembly element , Type attributeType ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
64- public static bool IsDefined ( Assembly element , Type attributeType , bool inherit ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
65- public static bool IsDefined ( MemberInfo element , Type attributeType ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
66- public static bool IsDefined ( MemberInfo element , Type attributeType , bool inherit ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
67- public static bool IsDefined ( Module element , Type attributeType ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
68- public static bool IsDefined ( Module element , Type attributeType , bool inherit ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
69- public static bool IsDefined ( ParameterInfo element , Type attributeType ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
70- public static bool IsDefined ( ParameterInfo element , Type attributeType , bool inherit ) => IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
71-
72- internal static bool IsDefined ( ICustomAttributeProvider element , Type attributeType , bool inherit )
73- {
74- if ( attributeType == null )
75- throw new ArgumentNullException ( nameof ( attributeType ) ) ;
76- if ( ! attributeType . IsSubclassOf ( typeof ( Attribute ) ) && attributeType != typeof ( Attribute ) )
77- throw new ArgumentException ( SR . Argument_MustHaveAttributeBaseClass + " " + attributeType . FullName ) ;
78-
79- return CustomAttribute . IsDefined ( element , attributeType , inherit ) ;
80- }
50+ public static Attribute [ ] GetCustomAttributes ( ParameterInfo element , Type attributeType ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
51+ public static Attribute [ ] GetCustomAttributes ( ParameterInfo element , Type attributeType , bool inherit ) => ( Attribute [ ] ) CustomAttribute . GetCustomAttributes ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
52+
53+ public static bool IsDefined ( Assembly element , Type attributeType ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
54+ public static bool IsDefined ( Assembly element , Type attributeType , bool inherit ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
55+ public static bool IsDefined ( MemberInfo element , Type attributeType ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
56+ public static bool IsDefined ( MemberInfo element , Type attributeType , bool inherit ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
57+ public static bool IsDefined ( Module element , Type attributeType ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
58+ public static bool IsDefined ( Module element , Type attributeType , bool inherit ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
59+ public static bool IsDefined ( ParameterInfo element , Type attributeType ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , true ) ;
60+ public static bool IsDefined ( ParameterInfo element , Type attributeType , bool inherit ) => CustomAttribute . IsDefined ( ( ICustomAttributeProvider ) element , attributeType , inherit ) ;
8161 }
8262}
0 commit comments