Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CustomAttributeExtensions.cs
Go to the documentation of this file.
2
3namespace System.Reflection;
4
5public static class CustomAttributeExtensions
6{
7 public static Attribute? GetCustomAttribute(this Assembly element, Type attributeType)
8 {
9 return Attribute.GetCustomAttribute(element, attributeType);
10 }
11
12 public static Attribute? GetCustomAttribute(this Module element, Type attributeType)
13 {
14 return Attribute.GetCustomAttribute(element, attributeType);
15 }
16
17 public static Attribute? GetCustomAttribute(this MemberInfo element, Type attributeType)
18 {
19 return Attribute.GetCustomAttribute(element, attributeType);
20 }
21
22 public static Attribute? GetCustomAttribute(this ParameterInfo element, Type attributeType)
23 {
24 return Attribute.GetCustomAttribute(element, attributeType);
25 }
26
27 public static T? GetCustomAttribute<T>(this Assembly element) where T : Attribute
28 {
29 return (T)element.GetCustomAttribute(typeof(T));
30 }
31
32 public static T? GetCustomAttribute<T>(this Module element) where T : Attribute
33 {
34 return (T)element.GetCustomAttribute(typeof(T));
35 }
36
37 public static T? GetCustomAttribute<T>(this MemberInfo element) where T : Attribute
38 {
39 return (T)element.GetCustomAttribute(typeof(T));
40 }
41
42 public static T? GetCustomAttribute<T>(this ParameterInfo element) where T : Attribute
43 {
44 return (T)element.GetCustomAttribute(typeof(T));
45 }
46
47 public static Attribute? GetCustomAttribute(this MemberInfo element, Type attributeType, bool inherit)
48 {
49 return Attribute.GetCustomAttribute(element, attributeType, inherit);
50 }
51
52 public static Attribute? GetCustomAttribute(this ParameterInfo element, Type attributeType, bool inherit)
53 {
54 return Attribute.GetCustomAttribute(element, attributeType, inherit);
55 }
56
57 public static T? GetCustomAttribute<T>(this MemberInfo element, bool inherit) where T : Attribute
58 {
59 return (T)element.GetCustomAttribute(typeof(T), inherit);
60 }
61
62 public static T? GetCustomAttribute<T>(this ParameterInfo element, bool inherit) where T : Attribute
63 {
64 return (T)element.GetCustomAttribute(typeof(T), inherit);
65 }
66
68 {
69 return Attribute.GetCustomAttributes(element);
70 }
71
73 {
74 return Attribute.GetCustomAttributes(element);
75 }
76
78 {
79 return Attribute.GetCustomAttributes(element);
80 }
81
83 {
84 return Attribute.GetCustomAttributes(element);
85 }
86
88 {
89 return Attribute.GetCustomAttributes(element, inherit);
90 }
91
93 {
94 return Attribute.GetCustomAttributes(element, inherit);
95 }
96
97 public static IEnumerable<Attribute> GetCustomAttributes(this Assembly element, Type attributeType)
98 {
99 return Attribute.GetCustomAttributes(element, attributeType);
100 }
101
102 public static IEnumerable<Attribute> GetCustomAttributes(this Module element, Type attributeType)
103 {
104 return Attribute.GetCustomAttributes(element, attributeType);
105 }
106
107 public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType)
108 {
109 return Attribute.GetCustomAttributes(element, attributeType);
110 }
111
112 public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType)
113 {
114 return Attribute.GetCustomAttributes(element, attributeType);
115 }
116
118 {
119 return (IEnumerable<T>)element.GetCustomAttributes(typeof(T));
120 }
121
123 {
124 return (IEnumerable<T>)element.GetCustomAttributes(typeof(T));
125 }
126
128 {
129 return (IEnumerable<T>)element.GetCustomAttributes(typeof(T));
130 }
131
133 {
134 return (IEnumerable<T>)element.GetCustomAttributes(typeof(T));
135 }
136
137 public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType, bool inherit)
138 {
139 return Attribute.GetCustomAttributes(element, attributeType, inherit);
140 }
141
142 public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType, bool inherit)
143 {
144 return Attribute.GetCustomAttributes(element, attributeType, inherit);
145 }
146
148 {
149 return (IEnumerable<T>)GetCustomAttributes(element, typeof(T), inherit);
150 }
151
153 {
154 return (IEnumerable<T>)GetCustomAttributes(element, typeof(T), inherit);
155 }
156
157 public static bool IsDefined(this Assembly element, Type attributeType)
158 {
159 return Attribute.IsDefined(element, attributeType);
160 }
161
162 public static bool IsDefined(this Module element, Type attributeType)
163 {
164 return Attribute.IsDefined(element, attributeType);
165 }
166
167 public static bool IsDefined(this MemberInfo element, Type attributeType)
168 {
169 return Attribute.IsDefined(element, attributeType);
170 }
171
172 public static bool IsDefined(this ParameterInfo element, Type attributeType)
173 {
174 return Attribute.IsDefined(element, attributeType);
175 }
176
177 public static bool IsDefined(this MemberInfo element, Type attributeType, bool inherit)
178 {
179 return Attribute.IsDefined(element, attributeType, inherit);
180 }
181
182 public static bool IsDefined(this ParameterInfo element, Type attributeType, bool inherit)
183 {
184 return Attribute.IsDefined(element, attributeType, inherit);
185 }
186}
static ? Attribute GetCustomAttribute(MemberInfo element, Type attributeType)
Definition Attribute.cs:411
static bool IsDefined(MemberInfo element, Type attributeType)
Definition Attribute.cs:384
static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType)
Definition Attribute.cs:338
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element)
static ? Attribute GetCustomAttribute(this ParameterInfo element, Type attributeType, bool inherit)
static ? Attribute GetCustomAttribute(this ParameterInfo element, Type attributeType)
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element, bool inherit)
static bool IsDefined(this Assembly element, Type attributeType)
static ? Attribute GetCustomAttribute(this Module element, Type attributeType)
static bool IsDefined(this ParameterInfo element, Type attributeType, bool inherit)
static bool IsDefined(this MemberInfo element, Type attributeType)
static IEnumerable< Attribute > GetCustomAttributes(this Assembly element, Type attributeType)
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element, bool inherit)
static IEnumerable< Attribute > GetCustomAttributes(this Module element, Type attributeType)
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element, Type attributeType, bool inherit)
static bool IsDefined(this Module element, Type attributeType)
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element, Type attributeType)
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element)
static ? Attribute GetCustomAttribute(this Assembly element, Type attributeType)
static bool IsDefined(this MemberInfo element, Type attributeType, bool inherit)
static bool IsDefined(this ParameterInfo element, Type attributeType)
static IEnumerable< Attribute > GetCustomAttributes(this ParameterInfo element, Type attributeType, bool inherit)
static ? Attribute GetCustomAttribute(this MemberInfo element, Type attributeType, bool inherit)
static IEnumerable< Attribute > GetCustomAttributes(this Module element)
static IEnumerable< Attribute > GetCustomAttributes(this Assembly element)
static IEnumerable< T > GetCustomAttributes< T >(this Assembly element)
static ? T GetCustomAttribute< T >(this Assembly element)
static IEnumerable< Attribute > GetCustomAttributes(this MemberInfo element, Type attributeType)
static ? Attribute GetCustomAttribute(this MemberInfo element, Type attributeType)