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

◆ FillAttributes() [2/2]

override void System.ComponentModel.ReflectPropertyDescriptor.FillAttributes ( IList attributes)
inlineprotected

Definition at line 606 of file ReflectPropertyDescriptor.cs.

607 {
608 foreach (Attribute attribute2 in TypeDescriptor.GetAttributes(PropertyType))
609 {
610 attributes.Add(attribute2);
611 }
613 int num = 0;
614 while (type != null && type != typeof(object))
615 {
616 num++;
617 type = type.BaseType;
618 }
619 if (num > 0)
620 {
622 Attribute[][] array = new Attribute[num][];
623 while (type != null && type != typeof(object))
624 {
625 MemberInfo memberInfo = null;
626 BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
627 memberInfo = ((!IsExtender) ? ((MemberInfo)type.GetProperty(Name, bindingAttr, null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>())) : ((MemberInfo)type.GetMethod("Get" + Name, bindingAttr, null, new Type[1] { _receiverType }, null)));
628 if (memberInfo != null)
629 {
630 array[--num] = ReflectTypeDescriptionProvider.ReflectGetAttributes(memberInfo);
631 }
632 type = type.BaseType;
633 }
634 Attribute[][] array2 = array;
635 foreach (Attribute[] array3 in array2)
636 {
637 if (array3 == null)
638 {
639 continue;
640 }
641 Attribute[] array4 = array3;
642 foreach (Attribute attribute in array4)
643 {
644 if (!(attribute is AttributeProviderAttribute attributeProviderAttribute))
645 {
646 continue;
647 }
648 Type type2 = Type.GetType(attributeProviderAttribute.TypeName);
649 if (!(type2 != null))
650 {
651 continue;
652 }
653 Attribute[] array5 = null;
654 if (!string.IsNullOrEmpty(attributeProviderAttribute.PropertyName))
655 {
656 MemberInfo[] member = type2.GetMember(attributeProviderAttribute.PropertyName);
657 if (member.Length != 0 && member[0] != null)
658 {
659 array5 = ReflectTypeDescriptionProvider.ReflectGetAttributes(member[0]);
660 }
661 }
662 else
663 {
664 array5 = ReflectTypeDescriptionProvider.ReflectGetAttributes(type2);
665 }
666 if (array5 != null)
667 {
668 Attribute[] array6 = array5;
669 foreach (Attribute value2 in array6)
670 {
671 attributes.Add(value2);
672 }
673 }
674 }
675 }
676 Attribute[][] array7 = array;
677 foreach (Attribute[] array8 in array7)
678 {
679 if (array8 != null)
680 {
681 Attribute[] array9 = array8;
682 foreach (Attribute value3 in array9)
683 {
684 attributes.Add(value3);
685 }
686 }
687 }
688 }
689 base.FillAttributes(attributes);
690 if (SetMethodValue == null)
691 {
692 attributes.Add(ReadOnlyAttribute.Yes);
693 }
694 }
static readonly Type[] EmptyTypes
Definition Type.cs:19
int Add(object? value)

References System.ComponentModel.ReflectPropertyDescriptor._componentClass, System.ComponentModel.ReflectPropertyDescriptor._receiverType, System.array, System.Type.EmptyTypes, System.ComponentModel.TypeDescriptor.GetAttributes(), System.Type.GetMember(), System.Type.GetType(), System.ComponentModel.ReflectPropertyDescriptor.IsExtender, System.ComponentModel.MemberDescriptor.Name, System.ComponentModel.ReflectPropertyDescriptor.PropertyType, System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetAttributes(), and System.type.