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

◆ GetRawDecimalConstant()

static decimal System.Reflection.RuntimeParameterInfo.GetRawDecimalConstant ( CustomAttributeData attr)
inlinestaticprivate

Definition at line 289 of file RuntimeParameterInfo.cs.

290 {
291 foreach (CustomAttributeNamedArgument namedArgument in attr.NamedArguments)
292 {
293 if (namedArgument.MemberInfo.Name.Equals("Value"))
294 {
295 return (decimal)namedArgument.TypedValue.Value;
296 }
297 }
298 ParameterInfo[] parameters = attr.Constructor.GetParameters();
300 if (parameters[2].ParameterType == typeof(uint))
301 {
302 int lo = (int)(uint)constructorArguments[4].Value;
303 int mid = (int)(uint)constructorArguments[3].Value;
304 int hi = (int)(uint)constructorArguments[2].Value;
305 byte b = (byte)constructorArguments[1].Value;
306 byte scale = (byte)constructorArguments[0].Value;
307 return new decimal(lo, mid, hi, b != 0, scale);
308 }
309 int lo2 = (int)constructorArguments[4].Value;
310 int mid2 = (int)constructorArguments[3].Value;
311 int hi2 = (int)constructorArguments[2].Value;
312 byte b2 = (byte)constructorArguments[1].Value;
313 byte scale2 = (byte)constructorArguments[0].Value;
314 return new decimal(lo2, mid2, hi2, b2 != 0, scale2);
315 }

References System.Reflection.RuntimeParameterInfo.ParameterType.

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