Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValidateType()

bool System.Reflection.Emit.CustomAttributeBuilder.ValidateType ( Type t)
inlineprivate

Definition at line 177 of file CustomAttributeBuilder.cs.

178 {
179 if (t.IsPrimitive)
180 {
181 if (t != typeof(IntPtr))
182 {
183 return t != typeof(UIntPtr);
184 }
185 return false;
186 }
187 if (t == typeof(string) || t == typeof(Type))
188 {
189 return true;
190 }
191 if (t.IsEnum)
192 {
193 TypeCode typeCode = Type.GetTypeCode(Enum.GetUnderlyingType(t));
194 if ((uint)(typeCode - 5) <= 7u)
195 {
196 return true;
197 }
198 return false;
199 }
200 if (t.IsArray)
201 {
202 if (t.GetArrayRank() == 1)
203 {
204 return ValidateType(t.GetElementType());
205 }
206 return false;
207 }
208 return t == typeof(object);
209 }

References System.Type.GetArrayRank(), System.Type.GetElementType(), System.Type.GetTypeCode(), System.Enum.GetUnderlyingType(), System.Type.IsArray, System.Type.IsEnum, System.Type.IsPrimitive, and System.Reflection.Emit.CustomAttributeBuilder.ValidateType().

Referenced by System.Reflection.Emit.CustomAttributeBuilder.CustomAttributeBuilder(), and System.Reflection.Emit.CustomAttributeBuilder.ValidateType().