Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RuntimeEventInfo.cs
Go to the documentation of this file.
2
3namespace System.Reflection;
4
5internal sealed class RuntimeEventInfo : EventInfo
6{
7 private int m_token;
8
10
11 private string m_name;
12
13 private unsafe void* m_utf8name;
14
16
18
20
22
24
26
28
30
31 public override MemberTypes MemberType => MemberTypes.Event;
32
33 public unsafe override string Name => m_name ?? (m_name = new MdUtf8String(m_utf8name).ToString());
34
36
38
40
41 public override int MetadataToken => m_token;
42
43 public override Module Module => GetRuntimeModule();
44
46
57
58 internal override bool CacheEquals(object o)
59 {
61 {
63 }
64 return false;
65 }
66
67 public override string ToString()
68 {
69 if (m_addMethod == null || m_addMethod.GetParametersNoCopy().Length == 0)
70 {
72 }
73 return m_addMethod.GetParametersNoCopy()[0].ParameterType.FormatTypeName() + " " + Name;
74 }
75
76 public override object[] GetCustomAttributes(bool inherit)
77 {
79 }
80
81 public override object[] GetCustomAttributes(Type attributeType, bool inherit)
82 {
83 if (attributeType == null)
84 {
85 throw new ArgumentNullException("attributeType");
86 }
87 RuntimeType runtimeType = attributeType.UnderlyingSystemType as RuntimeType;
88 if (runtimeType == null)
89 {
90 throw new ArgumentException(SR.Arg_MustBeType, "attributeType");
91 }
93 }
94
95 public override bool IsDefined(Type attributeType, bool inherit)
96 {
97 if (attributeType == null)
98 {
99 throw new ArgumentNullException("attributeType");
100 }
101 RuntimeType runtimeType = attributeType.UnderlyingSystemType as RuntimeType;
102 if (runtimeType == null)
103 {
104 throw new ArgumentException(SR.Arg_MustBeType, "attributeType");
105 }
107 }
108
113
118
123
124 public override MethodInfo[] GetOtherMethods(bool nonPublic)
125 {
127 if (m_otherMethod == null)
128 {
129 return Array.Empty<MethodInfo>();
130 }
131 for (int i = 0; i < m_otherMethod.Length; i++)
132 {
134 {
135 list.Add(m_otherMethod[i]);
136 }
137 }
138 return list.ToArray();
139 }
140
141 public override MethodInfo GetAddMethod(bool nonPublic)
142 {
144 {
145 return null;
146 }
147 return m_addMethod;
148 }
149
151 {
153 {
154 return null;
155 }
156 return m_removeMethod;
157 }
158
159 public override MethodInfo GetRaiseMethod(bool nonPublic)
160 {
162 {
163 return null;
164 }
165 return m_raiseMethod;
166 }
167}
static RuntimeMethodInfo AssignAssociates(int tkMethod, RuntimeType declaredType, RuntimeType reflectedType)
Definition Associates.cs:35
static bool IncludeAccessor(MethodInfo associate, bool nonPublic)
Definition Associates.cs:17
static object[] GetCustomAttributes(RuntimeType type, RuntimeType caType, bool inherit)
static bool IsDefined(RuntimeType type, RuntimeType caType, bool inherit)
static IList< CustomAttributeData > GetCustomAttributesInternal(RuntimeType target)
RuntimeType.RuntimeTypeCache m_reflectedTypeCache
override bool HasSameMetadataDefinitionAs(MemberInfo other)
override MethodInfo[] GetOtherMethods(bool nonPublic)
override IList< CustomAttributeData > GetCustomAttributesData()
unsafe RuntimeEventInfo(int tkEvent, RuntimeType declaredType, RuntimeType.RuntimeTypeCache reflectedTypeCache, out bool isPrivate)
override MethodInfo GetRemoveMethod(bool nonPublic)
override EventAttributes Attributes
override object[] GetCustomAttributes(Type attributeType, bool inherit)
override MethodInfo GetRaiseMethod(bool nonPublic)
override bool CacheEquals(object o)
override MethodInfo GetAddMethod(bool nonPublic)
override bool IsDefined(Type attributeType, bool inherit)
override object[] GetCustomAttributes(bool inherit)
override ParameterInfo[] GetParametersNoCopy()
RuntimeModule GetRuntimeModule()
static string Arg_MustBeType
Definition SR.cs:302
static string InvalidOperation_NoPublicAddMethod
Definition SR.cs:1474
Definition SR.cs:7
unsafe override string ToString()
static RuntimeModule GetModule(RuntimeType type)