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

◆ AssignAssociates() [2/2]

static void System.Reflection.Associates.AssignAssociates ( MetadataImport scope,
int mdPropEvent,
RuntimeType declaringType,
RuntimeType reflectedType,
out RuntimeMethodInfo addOn,
out RuntimeMethodInfo removeOn,
out RuntimeMethodInfo fireOn,
out RuntimeMethodInfo getter,
out RuntimeMethodInfo setter,
out MethodInfo[] other,
out bool composedOfAllPrivateMethods,
out BindingFlags bindingFlags )
inlinestaticpackage

Definition at line 72 of file Associates.cs.

73 {
74 addOn = (removeOn = (fireOn = (getter = (setter = null))));
75 Attributes attributes = Attributes.ComposedOfAllVirtualMethods | Attributes.ComposedOfAllPrivateMethods | Attributes.ComposedOfNoPublicMembers | Attributes.ComposedOfNoStaticMembers;
76 while (RuntimeTypeHandle.IsGenericVariable(reflectedType))
77 {
78 reflectedType = (RuntimeType)reflectedType.BaseType;
79 }
82 scope.Enum(MetadataTokenType.MethodDef, mdPropEvent, out var result);
83 int num = result.Length / 2;
84 for (int i = 0; i < num; i++)
85 {
86 int tkMethod = result[i * 2];
89 if (runtimeMethodInfo == null)
90 {
91 continue;
92 }
93 MethodAttributes attributes2 = runtimeMethodInfo.Attributes;
94 bool flag = (attributes2 & MethodAttributes.MemberAccessMask) == MethodAttributes.Private;
95 bool flag2 = (attributes2 & MethodAttributes.Virtual) != 0;
96 MethodAttributes methodAttributes = attributes2 & MethodAttributes.MemberAccessMask;
97 bool flag3 = methodAttributes == MethodAttributes.Public;
98 bool flag4 = (attributes2 & MethodAttributes.Static) != 0;
99 if (flag3)
100 {
101 attributes &= ~Attributes.ComposedOfNoPublicMembers;
102 attributes &= ~Attributes.ComposedOfAllPrivateMethods;
103 }
104 else if (!flag)
105 {
106 attributes &= ~Attributes.ComposedOfAllPrivateMethods;
107 }
108 if (flag4)
109 {
110 attributes &= ~Attributes.ComposedOfNoStaticMembers;
111 }
112 if (!flag2)
113 {
114 attributes &= ~Attributes.ComposedOfAllVirtualMethods;
115 }
117 {
118 case MethodSemanticsAttributes.Setter:
120 continue;
121 case MethodSemanticsAttributes.Getter:
122 getter = runtimeMethodInfo;
123 continue;
126 continue;
127 case MethodSemanticsAttributes.AddOn:
129 continue;
130 case MethodSemanticsAttributes.RemoveOn:
132 continue;
133 }
134 if (list == null)
135 {
136 list = new List<MethodInfo>(num);
137 }
139 }
140 bool isPublic = (attributes & Attributes.ComposedOfNoPublicMembers) == 0;
141 bool isStatic = (attributes & Attributes.ComposedOfNoStaticMembers) == 0;
142 bindingFlags = RuntimeType.FilterPreCalculate(isPublic, isInherited, isStatic);
143 composedOfAllPrivateMethods = (attributes & Attributes.ComposedOfAllPrivateMethods) != 0;
144 other = list?.ToArray();
145 }
static RuntimeMethodInfo AssignAssociates(int tkMethod, RuntimeType declaredType, RuntimeType reflectedType)
Definition Associates.cs:35

References System.Reflection.Associates.AssignAssociates(), System.Reflection.MetadataImport.Enum(), System.RuntimeType.FilterPreCalculate(), System.RuntimeTypeHandle.IsGenericVariable(), System.list, and System.other.