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

◆ GetDefaultValueInternal()

object System.Reflection.RuntimeParameterInfo.GetDefaultValueInternal ( bool raw)
inlineprivate

Definition at line 214 of file RuntimeParameterInfo.cs.

215 {
217 {
218 return DBNull.Value;
219 }
220 object obj = null;
222 {
223 if (raw)
224 {
225 CustomAttributeTypedArgument customAttributeTypedArgument = RuntimeCustomAttributeData.Filter(CustomAttributeData.GetCustomAttributes(this), typeof(DateTimeConstantAttribute), 0);
226 if (customAttributeTypedArgument.ArgumentType != null)
227 {
228 return new DateTime((long)customAttributeTypedArgument.Value);
229 }
230 }
231 else
232 {
234 if (customAttributes != null && customAttributes.Length != 0)
235 {
237 }
238 }
239 }
241 {
242 obj = MdConstant.GetValue(m_scope, m_tkParamDef, ParameterType.GetTypeHandleInternal(), raw);
243 }
244 if (obj == DBNull.Value)
245 {
246 if (raw)
247 {
248 foreach (CustomAttributeData customAttribute in CustomAttributeData.GetCustomAttributes(this))
249 {
250 Type declaringType = customAttribute.Constructor.DeclaringType;
252 {
254 }
256 {
258 }
259 else if (declaringType.IsSubclassOf(s_CustomConstantAttributeType))
260 {
262 }
263 }
264 }
265 else
266 {
268 if (customAttributes2.Length != 0)
269 {
271 }
272 else
273 {
275 if (customAttributes2.Length != 0)
276 {
278 }
279 }
280 }
281 }
282 if (obj == DBNull.Value)
283 {
284 m_noDefaultValue = true;
285 }
286 return obj;
287 }
static DateTime GetRawDateTimeConstant(CustomAttributeData attr)
static object GetRawConstant(CustomAttributeData attr)
override object[] GetCustomAttributes(bool inherit)
static decimal GetRawDecimalConstant(CustomAttributeData attr)
static bool IsNullToken(int token)

References System.DateTime, System.Reflection.RuntimeCustomAttributeData.Filter(), System.Reflection.RuntimeParameterInfo.GetCustomAttributes(), System.Reflection.CustomAttributeData.GetCustomAttributes(), System.Reflection.RuntimeParameterInfo.GetRawConstant(), System.Reflection.RuntimeParameterInfo.GetRawDateTimeConstant(), System.Reflection.RuntimeParameterInfo.GetRawDecimalConstant(), System.Reflection.MdConstant.GetValue(), System.Reflection.MetadataToken.IsNullToken(), System.Reflection.RuntimeParameterInfo.m_noDefaultValue, System.Reflection.RuntimeParameterInfo.m_scope, System.Reflection.RuntimeParameterInfo.m_tkParamDef, System.obj, System.Reflection.RuntimeParameterInfo.ParameterType, System.Reflection.RuntimeParameterInfo.s_CustomConstantAttributeType, System.Reflection.RuntimeParameterInfo.s_DecimalConstantAttributeType, and System.DBNull.Value.

Referenced by System.Reflection.RuntimeParameterInfo.GetDefaultValue().