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

◆ FieldMetadata() [2/2]

System.Diagnostics.Tracing.FieldMetadata.FieldMetadata ( string name,
TraceLoggingDataType dataType,
EventFieldTags tags,
byte countFlags,
ushort fixedCount = 0,
byte[] custom = null )
inlineprivate

Definition at line 26 of file FieldMetadata.cs.

27 {
28 if (name == null)
29 {
30 throw new ArgumentNullException("name", "This usually means that the object passed to Write is of a type that does not support being used as the top-level object in an event, e.g. a primitive or built-in type.");
31 }
32 Statics.CheckName(name);
33 int num = (int)(dataType & (TraceLoggingDataType)31);
34 this.name = name;
35 nameSize = Encoding.UTF8.GetByteCount(this.name) + 1;
36 inType = (byte)(num | countFlags);
37 outType = (byte)((uint)((int)dataType >> 8) & 0x7Fu);
38 this.tags = tags;
39 this.fixedCount = fixedCount;
40 this.custom = custom;
41 if (countFlags != 0)
42 {
43 switch (num)
44 {
45 case 0:
46 throw new NotSupportedException(SR.EventSource_NotSupportedArrayOfNil);
47 case 14:
48 throw new NotSupportedException(SR.EventSource_NotSupportedArrayOfBinary);
49 case 1:
50 case 2:
51 throw new NotSupportedException(SR.EventSource_NotSupportedArrayOfNullTerminatedString);
52 }
53 }
54 if ((this.tags & (EventFieldTags)268435455) != 0)
55 {
56 outType |= 128;
57 }
58 if (outType != 0)
59 {
60 inType |= 128;
61 }
62 }
static Encoding UTF8
Definition Encoding.cs:526

References System.Diagnostics.Tracing.Statics.CheckName(), System.Diagnostics.Tracing.FieldMetadata.custom, System.SR.EventSource_NotSupportedArrayOfBinary, System.SR.EventSource_NotSupportedArrayOfNil, System.SR.EventSource_NotSupportedArrayOfNullTerminatedString, System.Diagnostics.Tracing.FieldMetadata.fixedCount, System.Diagnostics.Tracing.FieldMetadata.inType, System.Diagnostics.Tracing.FieldMetadata.name, System.Diagnostics.Tracing.FieldMetadata.nameSize, System.Diagnostics.Tracing.FieldMetadata.outType, System.Diagnostics.Tracing.FieldMetadata.tags, and System.Text.Encoding.UTF8.