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

◆ GetMarshalAsCustomAttribute() [1/3]

static MarshalAsAttribute System.Reflection.PseudoCustomAttribute.GetMarshalAsCustomAttribute ( int token,
RuntimeModule scope )
inlinestaticprivate

Definition at line 282 of file PseudoCustomAttribute.cs.

283 {
284 ConstArray fieldMarshal = ModuleHandle.GetMetadataImport(scope).GetFieldMarshal(token);
285 if (fieldMarshal.Length == 0)
286 {
287 return null;
288 }
290 RuntimeType safeArrayUserDefinedSubType2 = (string.IsNullOrEmpty(safeArrayUserDefinedSubType) ? null : RuntimeTypeHandle.GetTypeByNameUsingCARules(safeArrayUserDefinedSubType, scope));
291 RuntimeType marshalTypeRef = null;
292 try
293 {
294 marshalTypeRef = ((marshalType == null) ? null : RuntimeTypeHandle.GetTypeByNameUsingCARules(marshalType, scope));
295 }
296 catch (TypeLoadException)
297 {
298 }
300 marshalAsAttribute.SafeArraySubType = safeArraySubType;
301 marshalAsAttribute.SafeArrayUserDefinedSubType = safeArrayUserDefinedSubType2;
302 marshalAsAttribute.IidParameterIndex = iidParamIndex;
303 marshalAsAttribute.ArraySubType = arraySubType;
304 marshalAsAttribute.SizeParamIndex = (short)sizeParamIndex;
305 marshalAsAttribute.SizeConst = sizeConst;
306 marshalAsAttribute.MarshalType = marshalType;
307 marshalAsAttribute.MarshalTypeRef = marshalTypeRef;
308 marshalAsAttribute.MarshalCookie = marshalCookie;
309 return marshalAsAttribute;
310 }

References System.Reflection.MetadataImport.GetMarshalAs(), System.ModuleHandle.GetMetadataImport(), and System.RuntimeTypeHandle.GetTypeByNameUsingCARules().