Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PropertyBuilder.cs
Go to the documentation of this file.
3
5
6public sealed class PropertyBuilder : PropertyInfo
7{
8 private string m_name;
9
10 private int m_tkProperty;
11
13
15
17
19
21
23
25
26 public override Type PropertyType => m_returnType;
27
29
30 public override bool CanRead
31 {
32 get
33 {
34 if (m_getMethod != null)
35 {
36 return true;
37 }
38 return false;
39 }
40 }
41
42 public override bool CanWrite
43 {
44 get
45 {
46 if (m_setMethod != null)
47 {
48 return true;
49 }
50 return false;
51 }
52 }
53
54 public override string Name => m_name;
55
56 public override Type? DeclaringType => m_containingType;
57
58 public override Type? ReflectedType => m_containingType;
59
60 internal PropertyBuilder(ModuleBuilder mod, string name, SignatureHelper sig, PropertyAttributes attr, Type returnType, int prToken, TypeBuilder containingType)
61 {
62 if (name == null)
63 {
64 throw new ArgumentNullException("name");
65 }
66 if (name.Length == 0)
67 {
68 throw new ArgumentException(SR.Argument_EmptyName, "name");
69 }
70 if (name[0] == '\0')
71 {
72 throw new ArgumentException(SR.Argument_IllegalName, "name");
73 }
74 m_name = name;
75 m_moduleBuilder = mod;
76 m_attributes = attr;
77 m_returnType = returnType;
78 m_tkProperty = prToken;
79 m_containingType = containingType;
80 }
81
82 public void SetConstant(object? defaultValue)
83 {
86 }
87
89 {
90 if (mdBuilder == null)
91 {
92 throw new ArgumentNullException("mdBuilder");
93 }
96 TypeBuilder.DefineMethodSemantics(new QCallModule(ref module), m_tkProperty, semantics, mdBuilder.MetadataToken);
97 }
98
99 public void SetGetMethod(MethodBuilder mdBuilder)
100 {
102 m_getMethod = mdBuilder;
103 }
104
105 public void SetSetMethod(MethodBuilder mdBuilder)
106 {
108 m_setMethod = mdBuilder;
109 }
110
111 public void AddOtherMethod(MethodBuilder mdBuilder)
112 {
114 }
115
116 public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
117 {
118 if (con == null)
119 {
120 throw new ArgumentNullException("con");
121 }
122 if (binaryAttribute == null)
123 {
124 throw new ArgumentNullException("binaryAttribute");
125 }
128 }
129
131 {
132 if (customBuilder == null)
133 {
134 throw new ArgumentNullException("customBuilder");
135 }
138 }
139
140 public override object GetValue(object? obj, object?[]? index)
141 {
143 }
144
145 public override object GetValue(object? obj, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture)
146 {
148 }
149
150 public override void SetValue(object? obj, object? value, object?[]? index)
151 {
153 }
154
155 public override void SetValue(object? obj, object? value, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture)
156 {
158 }
159
160 public override MethodInfo[] GetAccessors(bool nonPublic)
161 {
163 }
164
165 public override MethodInfo? GetGetMethod(bool nonPublic)
166 {
167 if (nonPublic || m_getMethod == null)
168 {
169 return m_getMethod;
170 }
172 {
173 return m_getMethod;
174 }
175 return null;
176 }
177
178 public override MethodInfo? GetSetMethod(bool nonPublic)
179 {
180 if (nonPublic || m_setMethod == null)
181 {
182 return m_setMethod;
183 }
185 {
186 return m_setMethod;
187 }
188 return null;
189 }
190
195
196 public override object[] GetCustomAttributes(bool inherit)
197 {
199 }
200
201 public override object[] GetCustomAttributes(Type attributeType, bool inherit)
202 {
204 }
205
206 public override bool IsDefined(Type attributeType, bool inherit)
207 {
209 }
210}
void CreateCustomAttribute(ModuleBuilder mod, int tkOwner)
int GetConstructorToken(ConstructorInfo con)
void SetMethodSemantics(MethodBuilder mdBuilder, MethodSemanticsAttributes semantics)
override object GetValue(object? obj, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture)
override void SetValue(object? obj, object? value, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture)
void SetSetMethod(MethodBuilder mdBuilder)
override? MethodInfo GetSetMethod(bool nonPublic)
override object GetValue(object? obj, object?[]? index)
override? MethodInfo GetGetMethod(bool nonPublic)
override ParameterInfo[] GetIndexParameters()
void SetGetMethod(MethodBuilder mdBuilder)
void AddOtherMethod(MethodBuilder mdBuilder)
void SetCustomAttribute(CustomAttributeBuilder customBuilder)
override PropertyAttributes Attributes
void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
PropertyBuilder(ModuleBuilder mod, string name, SignatureHelper sig, PropertyAttributes attr, Type returnType, int prToken, TypeBuilder containingType)
override object[] GetCustomAttributes(Type attributeType, bool inherit)
void SetConstant(object? defaultValue)
override MethodInfo[] GetAccessors(bool nonPublic)
override void SetValue(object? obj, object? value, object?[]? index)
override object[] GetCustomAttributes(bool inherit)
override bool IsDefined(Type attributeType, bool inherit)
static void DefineCustomAttribute(QCallModule module, int tkAssociate, int tkConstructor, byte[] attr, int attrLength)
static void DefineMethodSemantics(QCallModule module, int tkAssociation, MethodSemanticsAttributes semantics, int tkMethod)
static unsafe void SetConstantValue(QCallModule module, int tk, int corType, void *pValue)
MethodAttributes Attributes
Definition MethodBase.cs:24
static string NotSupported_DynamicModule
Definition SR.cs:1672
static string Argument_IllegalName
Definition SR.cs:630
static string Argument_EmptyName
Definition SR.cs:584
Definition SR.cs:7