Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Attribute.cs
Go to the documentation of this file.
5
6namespace System;
7
9[AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)]
10[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
11public abstract class Attribute
12{
13 public virtual object TypeId => GetType();
14
42
43 private static bool InternalIsDefined(PropertyInfo element, Type attributeType, bool inherit)
44 {
45 if (element.IsDefined(attributeType, inherit))
46 {
47 return true;
48 }
49 if (inherit)
50 {
52 if (!attributeUsageAttribute.Inherited)
53 {
54 return false;
55 }
58 while (parentDefinition != null)
59 {
60 if (parentDefinition.IsDefined(attributeType, inherit: false))
61 {
62 return true;
63 }
65 }
66 }
67 return false;
68 }
69
70 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern", Justification = "rtPropAccessor.DeclaringType is guaranteed to have the specified property because rtPropAccessor.GetParentDefinition() returned a non-null MethodInfo.")]
72 {
73 MethodInfo methodInfo = property.GetGetMethod(nonPublic: true) ?? property.GetSetMethod(nonPublic: true);
75 if (runtimeMethodInfo != null)
76 {
77 runtimeMethodInfo = runtimeMethodInfo.GetParentDefinition();
78 if (runtimeMethodInfo != null)
79 {
80 return runtimeMethodInfo.DeclaringType.GetProperty(property.Name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, property.PropertyType, propertyParameters, null);
81 }
82 }
83 return null;
84 }
85
112
113 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern", Justification = "rtAdd.DeclaringType is guaranteed to have the specified event because rtAdd.GetParentDefinition() returned a non-null MethodInfo.")]
115 {
116 MethodInfo addMethod = ev.GetAddMethod(nonPublic: true);
118 if (runtimeMethodInfo != null)
119 {
120 runtimeMethodInfo = runtimeMethodInfo.GetParentDefinition();
121 if (runtimeMethodInfo != null)
122 {
123 return runtimeMethodInfo.DeclaringType.GetEvent(ev.Name);
124 }
125 }
126 return null;
127 }
128
129 private static bool InternalIsDefined(EventInfo element, Type attributeType, bool inherit)
130 {
131 if (element.IsDefined(attributeType, inherit))
132 {
133 return true;
134 }
135 if (inherit)
136 {
138 if (!attributeUsageAttribute.Inherited)
139 {
140 return false;
141 }
143 while (parentDefinition != null)
144 {
145 if (parentDefinition.IsDefined(attributeType, inherit: false))
146 {
147 return true;
148 }
150 }
151 }
152 return false;
153 }
154
156 {
158 if (runtimeMethodInfo != null)
159 {
160 runtimeMethodInfo = runtimeMethodInfo.GetParentDefinition();
161 if (runtimeMethodInfo != null)
162 {
163 int position = param.Position;
164 if (position == -1)
165 {
166 return runtimeMethodInfo.ReturnParameter;
167 }
168 ParameterInfo[] parameters = runtimeMethodInfo.GetParameters();
169 return parameters[position];
170 }
171 }
172 return null;
173 }
174
176 {
177 List<Type> list = new List<Type>();
178 if ((object)type == null)
179 {
181 }
182 object[] customAttributes = param.GetCustomAttributes(type, inherit: false);
183 for (int i = 0; i < customAttributes.Length; i++)
184 {
185 Type type2 = customAttributes[i].GetType();
187 if (!attributeUsageAttribute.AllowMultiple)
188 {
189 list.Add(type2);
190 }
191 }
192 Attribute[] array = ((customAttributes.Length != 0) ? ((Attribute[])customAttributes) : CreateAttributeArrayHelper(type, 0));
193 if ((object)param.Member.DeclaringType == null)
194 {
195 return array;
196 }
197 if (!inherit)
198 {
199 return array;
200 }
202 {
203 customAttributes = parentDefinition.GetCustomAttributes(type, inherit: false);
204 int num = 0;
205 for (int j = 0; j < customAttributes.Length; j++)
206 {
207 Type type3 = customAttributes[j].GetType();
209 if (attributeUsageAttribute2.Inherited && !list.Contains(type3))
210 {
211 if (!attributeUsageAttribute2.AllowMultiple)
212 {
213 list.Add(type3);
214 }
215 num++;
216 }
217 else
218 {
219 customAttributes[j] = null;
220 }
221 }
223 num = 0;
224 foreach (object obj in customAttributes)
225 {
226 if (obj != null)
227 {
228 array2[num] = (Attribute)obj;
229 num++;
230 }
231 }
234 Array.Copy(array3, array, array3.Length);
235 int num2 = array3.Length;
236 for (int l = 0; l < array2.Length; l++)
237 {
238 array[num2 + l] = array2[l];
239 }
240 }
241 return array;
242 }
243
245 {
246 if (param.IsDefined(type, inherit: false))
247 {
248 return true;
249 }
250 if ((object)param.Member.DeclaringType == null || !inherit)
251 {
252 return false;
253 }
255 {
256 object[] customAttributes = parentDefinition.GetCustomAttributes(type, inherit: false);
257 for (int i = 0; i < customAttributes.Length; i++)
258 {
259 Type type2 = customAttributes[i].GetType();
262 {
263 return true;
264 }
265 }
266 }
267 return false;
268 }
269
271 {
272 for (int i = 0; i < attributes.Length; i++)
273 {
274 attributeList.Add(attributes[i]);
275 Type type = attributes[i].GetType();
276 if (!types.ContainsKey(type))
277 {
279 }
280 }
281 }
282
283 private static Type[] GetIndexParameterTypes(PropertyInfo element)
284 {
286 if (indexParameters.Length != 0)
287 {
288 Type[] array = new Type[indexParameters.Length];
289 for (int i = 0; i < indexParameters.Length; i++)
290 {
291 array[i] = indexParameters[i].ParameterType;
292 }
293 return array;
294 }
295 return Type.EmptyTypes;
296 }
297
299 {
300 for (int i = 0; i < attributes.Length; i++)
301 {
302 Type type = attributes[i].GetType();
304 if (value == null)
305 {
307 if (value.Inherited)
308 {
309 attributeList.Add(attributes[i]);
310 }
311 }
312 else if (value.Inherited && value.AllowMultiple)
313 {
314 attributeList.Add(attributes[i]);
315 }
316 }
317 }
318
320 {
321 object[] customAttributes = type.GetCustomAttributes(typeof(AttributeUsageAttribute), inherit: false);
322 if (customAttributes.Length == 1)
323 {
325 }
326 if (customAttributes.Length == 0)
327 {
329 }
331 }
332
337
338 public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType)
339 {
340 return GetCustomAttributes(element, attributeType, inherit: true);
341 }
342
343 public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType, bool inherit)
344 {
345 if (element == null)
346 {
347 throw new ArgumentNullException("element");
348 }
349 if (attributeType == null)
350 {
351 throw new ArgumentNullException("attributeType");
352 }
353 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
354 {
356 }
357 return element.MemberType switch
358 {
359 MemberTypes.Property => InternalGetCustomAttributes((PropertyInfo)element, attributeType, inherit),
360 MemberTypes.Event => InternalGetCustomAttributes((EventInfo)element, attributeType, inherit),
361 _ => element.GetCustomAttributes(attributeType, inherit) as Attribute[],
362 };
363 }
364
365 public static Attribute[] GetCustomAttributes(MemberInfo element)
366 {
367 return GetCustomAttributes(element, inherit: true);
368 }
369
370 public static Attribute[] GetCustomAttributes(MemberInfo element, bool inherit)
371 {
372 if (element == null)
373 {
374 throw new ArgumentNullException("element");
375 }
376 return element.MemberType switch
377 {
378 MemberTypes.Property => InternalGetCustomAttributes((PropertyInfo)element, typeof(Attribute), inherit),
379 MemberTypes.Event => InternalGetCustomAttributes((EventInfo)element, typeof(Attribute), inherit),
381 };
382 }
383
384 public static bool IsDefined(MemberInfo element, Type attributeType)
385 {
386 return IsDefined(element, attributeType, inherit: true);
387 }
388
389 public static bool IsDefined(MemberInfo element, Type attributeType, bool inherit)
390 {
391 if (element == null)
392 {
393 throw new ArgumentNullException("element");
394 }
395 if (attributeType == null)
396 {
397 throw new ArgumentNullException("attributeType");
398 }
399 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
400 {
402 }
403 return element.MemberType switch
404 {
405 MemberTypes.Property => InternalIsDefined((PropertyInfo)element, attributeType, inherit),
406 MemberTypes.Event => InternalIsDefined((EventInfo)element, attributeType, inherit),
407 _ => element.IsDefined(attributeType, inherit),
408 };
409 }
410
411 public static Attribute? GetCustomAttribute(MemberInfo element, Type attributeType)
412 {
413 return GetCustomAttribute(element, attributeType, inherit: true);
414 }
415
416 public static Attribute? GetCustomAttribute(MemberInfo element, Type attributeType, bool inherit)
417 {
418 Attribute[] customAttributes = GetCustomAttributes(element, attributeType, inherit);
419 if (customAttributes == null || customAttributes.Length == 0)
420 {
421 return null;
422 }
423 if (customAttributes.Length == 1)
424 {
425 return customAttributes[0];
426 }
428 }
429
431 {
432 return GetCustomAttributes(element, inherit: true);
433 }
434
435 public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType)
436 {
437 return GetCustomAttributes(element, attributeType, inherit: true);
438 }
439
440 public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType, bool inherit)
441 {
442 if (element == null)
443 {
444 throw new ArgumentNullException("element");
445 }
446 if (attributeType == null)
447 {
448 throw new ArgumentNullException("attributeType");
449 }
450 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
451 {
453 }
454 if (element.Member == null)
455 {
457 }
458 MemberInfo member = element.Member;
459 if (member.MemberType == MemberTypes.Method && inherit)
460 {
461 return InternalParamGetCustomAttributes(element, attributeType, inherit);
462 }
463 return element.GetCustomAttributes(attributeType, inherit) as Attribute[];
464 }
465
466 public static Attribute[] GetCustomAttributes(ParameterInfo element, bool inherit)
467 {
468 if (element == null)
469 {
470 throw new ArgumentNullException("element");
471 }
472 if (element.Member == null)
473 {
475 }
476 MemberInfo member = element.Member;
477 if (member.MemberType == MemberTypes.Method && inherit)
478 {
479 return InternalParamGetCustomAttributes(element, null, inherit);
480 }
482 }
483
484 public static bool IsDefined(ParameterInfo element, Type attributeType)
485 {
486 return IsDefined(element, attributeType, inherit: true);
487 }
488
489 public static bool IsDefined(ParameterInfo element, Type attributeType, bool inherit)
490 {
491 if (element == null)
492 {
493 throw new ArgumentNullException("element");
494 }
495 if (attributeType == null)
496 {
497 throw new ArgumentNullException("attributeType");
498 }
499 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
500 {
502 }
503 MemberInfo member = element.Member;
504 return member.MemberType switch
505 {
506 MemberTypes.Method => InternalParamIsDefined(element, attributeType, inherit),
507 MemberTypes.Constructor => element.IsDefined(attributeType, inherit: false),
508 MemberTypes.Property => element.IsDefined(attributeType, inherit: false),
510 };
511 }
512
513 public static Attribute? GetCustomAttribute(ParameterInfo element, Type attributeType)
514 {
515 return GetCustomAttribute(element, attributeType, inherit: true);
516 }
517
518 public static Attribute? GetCustomAttribute(ParameterInfo element, Type attributeType, bool inherit)
519 {
520 Attribute[] customAttributes = GetCustomAttributes(element, attributeType, inherit);
521 if (customAttributes == null || customAttributes.Length == 0)
522 {
523 return null;
524 }
525 if (customAttributes.Length == 0)
526 {
527 return null;
528 }
529 if (customAttributes.Length == 1)
530 {
531 return customAttributes[0];
532 }
534 }
535
536 public static Attribute[] GetCustomAttributes(Module element, Type attributeType)
537 {
538 return GetCustomAttributes(element, attributeType, inherit: true);
539 }
540
541 public static Attribute[] GetCustomAttributes(Module element)
542 {
543 return GetCustomAttributes(element, inherit: true);
544 }
545
546 public static Attribute[] GetCustomAttributes(Module element, bool inherit)
547 {
548 if (element == null)
549 {
550 throw new ArgumentNullException("element");
551 }
553 }
554
555 public static Attribute[] GetCustomAttributes(Module element, Type attributeType, bool inherit)
556 {
557 if (element == null)
558 {
559 throw new ArgumentNullException("element");
560 }
561 if (attributeType == null)
562 {
563 throw new ArgumentNullException("attributeType");
564 }
565 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
566 {
568 }
569 return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
570 }
571
572 public static bool IsDefined(Module element, Type attributeType)
573 {
574 return IsDefined(element, attributeType, inherit: false);
575 }
576
577 public static bool IsDefined(Module element, Type attributeType, bool inherit)
578 {
579 if (element == null)
580 {
581 throw new ArgumentNullException("element");
582 }
583 if (attributeType == null)
584 {
585 throw new ArgumentNullException("attributeType");
586 }
587 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
588 {
590 }
591 return element.IsDefined(attributeType, inherit: false);
592 }
593
594 public static Attribute? GetCustomAttribute(Module element, Type attributeType)
595 {
596 return GetCustomAttribute(element, attributeType, inherit: true);
597 }
598
599 public static Attribute? GetCustomAttribute(Module element, Type attributeType, bool inherit)
600 {
601 Attribute[] customAttributes = GetCustomAttributes(element, attributeType, inherit);
602 if (customAttributes == null || customAttributes.Length == 0)
603 {
604 return null;
605 }
606 if (customAttributes.Length == 1)
607 {
608 return customAttributes[0];
609 }
611 }
612
613 public static Attribute[] GetCustomAttributes(Assembly element, Type attributeType)
614 {
615 return GetCustomAttributes(element, attributeType, inherit: true);
616 }
617
618 public static Attribute[] GetCustomAttributes(Assembly element, Type attributeType, bool inherit)
619 {
620 if (element == null)
621 {
622 throw new ArgumentNullException("element");
623 }
624 if (attributeType == null)
625 {
626 throw new ArgumentNullException("attributeType");
627 }
628 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
629 {
631 }
632 return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
633 }
634
635 public static Attribute[] GetCustomAttributes(Assembly element)
636 {
637 return GetCustomAttributes(element, inherit: true);
638 }
639
640 public static Attribute[] GetCustomAttributes(Assembly element, bool inherit)
641 {
642 if (element == null)
643 {
644 throw new ArgumentNullException("element");
645 }
647 }
648
649 public static bool IsDefined(Assembly element, Type attributeType)
650 {
651 return IsDefined(element, attributeType, inherit: true);
652 }
653
654 public static bool IsDefined(Assembly element, Type attributeType, bool inherit)
655 {
656 if (element == null)
657 {
658 throw new ArgumentNullException("element");
659 }
660 if (attributeType == null)
661 {
662 throw new ArgumentNullException("attributeType");
663 }
664 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
665 {
667 }
668 return element.IsDefined(attributeType, inherit: false);
669 }
670
671 public static Attribute? GetCustomAttribute(Assembly element, Type attributeType)
672 {
673 return GetCustomAttribute(element, attributeType, inherit: true);
674 }
675
676 public static Attribute? GetCustomAttribute(Assembly element, Type attributeType, bool inherit)
677 {
678 Attribute[] customAttributes = GetCustomAttributes(element, attributeType, inherit);
679 if (customAttributes == null || customAttributes.Length == 0)
680 {
681 return null;
682 }
683 if (customAttributes.Length == 1)
684 {
685 return customAttributes[0];
686 }
688 }
689
690 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern", Justification = "Unused fields don't make a difference for equality")]
691 public override bool Equals([NotNullWhen(true)] object? obj)
692 {
693 if (obj == null)
694 {
695 return false;
696 }
697 if (GetType() != obj.GetType())
698 {
699 return false;
700 }
701 Type type = GetType();
702 while (type != typeof(Attribute))
703 {
704 FieldInfo[] fields = type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
705 for (int i = 0; i < fields.Length; i++)
706 {
707 object value = fields[i].GetValue(this);
708 object value2 = fields[i].GetValue(obj);
710 {
711 return false;
712 }
713 }
714 type = type.BaseType;
715 }
716 return true;
717 }
718
719 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern", Justification = "Unused fields don't make a difference for hashcode quality")]
720 public override int GetHashCode()
721 {
722 Type type = GetType();
723 while (type != typeof(Attribute))
724 {
725 FieldInfo[] fields = type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
726 object obj = null;
727 for (int i = 0; i < fields.Length; i++)
728 {
729 object value = fields[i].GetValue(this);
730 if (value != null && !value.GetType().IsArray)
731 {
732 obj = value;
733 }
734 if (obj != null)
735 {
736 break;
737 }
738 }
739 if (obj != null)
740 {
741 return obj.GetHashCode();
742 }
743 type = type.BaseType;
744 }
745 return type.GetHashCode();
746 }
747
748 private static bool AreFieldValuesEqual(object thisValue, object thatValue)
749 {
750 if (thisValue == null && thatValue == null)
751 {
752 return true;
753 }
754 if (thisValue == null || thatValue == null)
755 {
756 return false;
757 }
758 Type type = thisValue.GetType();
759 if (type.IsArray)
760 {
761 if (!type.Equals(thatValue.GetType()))
762 {
763 return false;
764 }
767 if (array.Length != array2.Length)
768 {
769 return false;
770 }
771 for (int i = 0; i < array.Length; i++)
772 {
773 if (!AreFieldValuesEqual(array.GetValue(i), array2.GetValue(i)))
774 {
775 return false;
776 }
777 }
778 }
779 else if (!thisValue.Equals(thatValue))
780 {
781 return false;
782 }
783 return true;
784 }
785
786 public virtual bool Match(object? obj)
787 {
788 return Equals(obj);
789 }
790
791 public virtual bool IsDefaultAttribute()
792 {
793 return false;
794 }
795}
static unsafe Array CreateInstance(Type elementType, int length)
Definition Array.cs:473
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
static readonly AttributeUsageAttribute Default
static ParameterInfo GetParentDefinition(ParameterInfo param)
Definition Attribute.cs:155
static ? Attribute GetCustomAttribute(ParameterInfo element, Type attributeType)
Definition Attribute.cs:513
static Attribute[] GetCustomAttributes(Module element, Type attributeType)
Definition Attribute.cs:536
static bool AreFieldValuesEqual(object thisValue, object thatValue)
Definition Attribute.cs:748
static Attribute[] GetCustomAttributes(Assembly element)
Definition Attribute.cs:635
virtual object TypeId
Definition Attribute.cs:13
static AttributeUsageAttribute InternalGetAttributeUsage(Type type)
Definition Attribute.cs:319
static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:343
static Attribute[] InternalGetCustomAttributes(PropertyInfo element, Type type, bool inherit)
Definition Attribute.cs:15
static Attribute[] GetCustomAttributes(Assembly element, Type attributeType)
Definition Attribute.cs:613
override int GetHashCode()
Definition Attribute.cs:720
static bool IsDefined(ParameterInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:489
static Attribute[] InternalParamGetCustomAttributes(ParameterInfo param, Type type, bool inherit)
Definition Attribute.cs:175
static Attribute[] GetCustomAttributes(MemberInfo element)
Definition Attribute.cs:365
static Attribute[] GetCustomAttributes(MemberInfo element, bool inherit)
Definition Attribute.cs:370
override bool Equals([NotNullWhen(true)] object? obj)
Definition Attribute.cs:691
static ? Attribute GetCustomAttribute(MemberInfo element, Type attributeType)
Definition Attribute.cs:411
static bool IsDefined(Assembly element, Type attributeType)
Definition Attribute.cs:649
static ? Attribute GetCustomAttribute(MemberInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:416
static bool InternalIsDefined(PropertyInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:43
static ? Attribute GetCustomAttribute(Assembly element, Type attributeType, bool inherit)
Definition Attribute.cs:676
static bool IsDefined(MemberInfo element, Type attributeType)
Definition Attribute.cs:384
static Attribute[] GetCustomAttributes(ParameterInfo element, bool inherit)
Definition Attribute.cs:466
virtual bool Match(object? obj)
Definition Attribute.cs:786
static EventInfo GetParentDefinition(EventInfo ev)
Definition Attribute.cs:114
static Attribute[] CreateAttributeArrayHelper(Type elementType, int elementCount)
Definition Attribute.cs:333
static bool IsDefined(MemberInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:389
static Attribute[] GetCustomAttributes(ParameterInfo element)
Definition Attribute.cs:430
static ? Attribute GetCustomAttribute(ParameterInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:518
static void CopyToAttributeList(List< Attribute > attributeList, Attribute[] attributes, Dictionary< Type, AttributeUsageAttribute > types)
Definition Attribute.cs:270
static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType)
Definition Attribute.cs:338
static Attribute[] GetCustomAttributes(Module element, Type attributeType, bool inherit)
Definition Attribute.cs:555
virtual bool IsDefaultAttribute()
Definition Attribute.cs:791
static Attribute[] InternalGetCustomAttributes(EventInfo element, Type type, bool inherit)
Definition Attribute.cs:86
static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType)
Definition Attribute.cs:435
static Attribute[] GetCustomAttributes(Assembly element, bool inherit)
Definition Attribute.cs:640
static bool IsDefined(ParameterInfo element, Type attributeType)
Definition Attribute.cs:484
static PropertyInfo GetParentDefinition(PropertyInfo property, Type[] propertyParameters)
Definition Attribute.cs:71
static bool IsDefined(Module element, Type attributeType)
Definition Attribute.cs:572
static bool IsDefined(Assembly element, Type attributeType, bool inherit)
Definition Attribute.cs:654
static ? Attribute GetCustomAttribute(Assembly element, Type attributeType)
Definition Attribute.cs:671
static void AddAttributesToList(List< Attribute > attributeList, Attribute[] attributes, Dictionary< Type, AttributeUsageAttribute > types)
Definition Attribute.cs:298
static bool IsDefined(Module element, Type attributeType, bool inherit)
Definition Attribute.cs:577
static Attribute[] GetCustomAttributes(Module element, bool inherit)
Definition Attribute.cs:546
static Type[] GetIndexParameterTypes(PropertyInfo element)
Definition Attribute.cs:283
static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:440
static bool InternalIsDefined(EventInfo element, Type attributeType, bool inherit)
Definition Attribute.cs:129
static Attribute[] GetCustomAttributes(Module element)
Definition Attribute.cs:541
static Attribute[] GetCustomAttributes(Assembly element, Type attributeType, bool inherit)
Definition Attribute.cs:618
static ? Attribute GetCustomAttribute(Module element, Type attributeType, bool inherit)
Definition Attribute.cs:599
static bool InternalParamIsDefined(ParameterInfo param, Type type, bool inherit)
Definition Attribute.cs:244
static ? Attribute GetCustomAttribute(Module element, Type attributeType)
Definition Attribute.cs:594
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
virtual bool IsDefined(Type attributeType, bool inherit)
Definition Assembly.cs:322
virtual object[] GetCustomAttributes(bool inherit)
Definition Assembly.cs:332
object? GetValue(object? obj)
bool IsDefined(Type attributeType, bool inherit)
object[] GetCustomAttributes(bool inherit)
virtual bool IsDefined(Type attributeType, bool inherit)
Definition Module.cs:91
virtual object[] GetCustomAttributes(bool inherit)
Definition Module.cs:101
virtual bool IsDefined(Type attributeType, bool inherit)
virtual object[] GetCustomAttributes(bool inherit)
ParameterInfo[] GetIndexParameters()
static string Argument_MustHaveAttributeBaseClass
Definition SR.cs:786
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Argument_InvalidParameterInfo
Definition SR.cs:726
static string Format_AttributeUsage
Definition SR.cs:1316
static string RFLCT_AmbigCust
Definition SR.cs:1834
static string Argument_InvalidParamInfo
Definition SR.cs:728
Definition SR.cs:7
virtual bool IsSubclassOf(Type c)
Definition Type.cs:1542
static readonly Type[] EmptyTypes
Definition Type.cs:19