Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ OffsetOf()

static IntPtr System.Runtime.InteropServices.Marshal.OffsetOf ( Type t,
string fieldName )
inlinestatic

Definition at line 28 of file Marshal.cs.

29 {
30 if ((object)t == null)
31 {
32 throw new ArgumentNullException("t");
33 }
34 FieldInfo field = t.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
35 if ((object)field == null)
36 {
37 throw new ArgumentException(SR.Format(SR.Argument_OffsetOfFieldNotFound, t.FullName), "fieldName");
38 }
39 if (!(field is RtFieldInfo f))
40 {
41 throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo, "fieldName");
42 }
43 return OffsetOfHelper(f);
44 }
static IntPtr OffsetOfHelper(IRuntimeFieldInfo f)

References System.SR.Argument_MustBeRuntimeFieldInfo, System.SR.Argument_OffsetOfFieldNotFound, System.SR.Format(), System.Type.FullName, System.Type.GetField(), and System.Runtime.InteropServices.Marshal.OffsetOfHelper().

Referenced by System.Security.Principal.WindowsIdentity.AddDeviceGroupSidClaims(), System.Security.Principal.WindowsIdentity.AddGroupSidClaims(), and System.Runtime.InteropServices.Marshal.OffsetOf< T >().