private void AddField(FieldMetadata fieldMetadata) { this.Tags = EventFieldTags.None; this.bufferedArrayFieldCount++; this.impl.fields.Add(fieldMetadata); this.currentGroup?.IncrementStructFieldCount(); }
private FieldMetadata( string name, TraceLoggingDataType dataType, EventFieldTags tags, byte countFlags, ushort fixedCount = 0, byte[] custom = null) { if (name == null) { throw new ArgumentNullException( nameof(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."); } Statics.CheckName(name); var coreType = (int)dataType & Statics.InTypeMask; this.name = name; nameSize = Encoding.UTF8.GetByteCount(this.name) + 1; inType = (byte)(coreType | countFlags); outType = (byte)(((int)dataType >> 8) & Statics.OutTypeMask); this.tags = tags; this.fixedCount = fixedCount; this.custom = custom; if (countFlags != 0) { if (coreType == (int)TraceLoggingDataType.Nil) { throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfNil")); } if (coreType == (int)TraceLoggingDataType.Binary) { throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfBinary")); } #if !BROKEN_UNTIL_M3 if (coreType == (int)TraceLoggingDataType.Utf16String || coreType == (int)TraceLoggingDataType.MbcsString) { throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfNullTerminatedString")); } #endif } if (((int)this.tags & 0xfffffff) != 0) { outType |= Statics.OutTypeChainFlag; } if (outType != 0) { inType |= Statics.InTypeChainFlag; } }
/// <summary> /// Custom serializer /// </summary> public FieldMetadata( string name, TraceLoggingDataType type, EventFieldTags tags, byte[]?custom) : this( name, type, tags, Statics.InTypeCustomCountFlag, checked ((ushort)(custom == null ? 0 : custom.Length)), custom) { }
/// <summary> /// Fixed-length array. /// </summary> public FieldMetadata( string name, TraceLoggingDataType type, EventFieldTags tags, ushort fixedCount) : this( name, type, tags, Statics.InTypeFixedCountFlag, fixedCount, null) { }
/// <summary> /// Scalar or variable-length array. /// </summary> public FieldMetadata( string name, TraceLoggingDataType type, EventFieldTags tags, bool variableCount) : this( name, type, tags, variableCount ? Statics.InTypeVariableCountFlag : (byte)0, 0, null) { }
/// <summary> /// Fixed-length array. /// </summary> public FieldMetadata( string name, TraceLoggingDataType type, EventFieldTags tags, ushort fixedCount) : this( name, type, tags, Statics.InTypeFixedCountFlag, fixedCount, null) { return; }
/// <summary> /// Scalar or variable-length array. /// </summary> public FieldMetadata( string name, TraceLoggingDataType type, EventFieldTags tags, bool variableCount) : this( name, type, tags, variableCount ? Statics.InTypeVariableCountFlag : (byte)0, 0, null) { return; }
/// <summary> /// Custom serializer /// </summary> public FieldMetadata( string name, TraceLoggingDataType type, EventFieldTags tags, byte[] custom) : this( name, type, tags, Statics.InTypeCustomCountFlag, checked((ushort)(custom == null ? 0 : custom.Length)), custom) { return; }
private FieldMetadata(string name, TraceLoggingDataType dataType, EventFieldTags tags, byte countFlags, ushort fixedCount = 0, byte[] custom = null) { if (name == null) { 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."); } Statics.CheckName(name); int num = (int)(dataType & (TraceLoggingDataType)31); this.name = name; this.nameSize = Encoding.UTF8.GetByteCount(this.name) + 1; this.inType = (byte)((uint)num | (uint)countFlags); this.outType = (byte)((int)dataType >> 8 & (int)sbyte.MaxValue); this.tags = tags; this.fixedCount = fixedCount; this.custom = custom; if ((int)countFlags != 0) { if (num == 0) { throw new NotSupportedException(Environment.GetResourceString("EventSource_NotSupportedArrayOfNil")); } if (num == 14) { throw new NotSupportedException(Environment.GetResourceString("EventSource_NotSupportedArrayOfBinary")); } if (num == 1 || num == 2) { throw new NotSupportedException(Environment.GetResourceString("EventSource_NotSupportedArrayOfNullTerminatedString")); } } if ((this.tags & (EventFieldTags)268435455) != EventFieldTags.None) { this.outType = (byte)((uint)this.outType | 128U); } if ((int)this.outType == 0) { return; } this.inType = (byte)((uint)this.inType | 128U); }
private FieldMetadata( string name, TraceLoggingDataType dataType, EventFieldTags tags, byte countFlags, ushort fixedCount = 0, byte[] custom = null) { if (name == null) { throw new ArgumentNullException( nameof(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."); } Statics.CheckName(name); var coreType = (int)dataType & Statics.InTypeMask; this.name = name; this.nameSize = Encoding.UTF8.GetByteCount(this.name) + 1; this.inType = (byte)(coreType | countFlags); this.outType = (byte)(((int)dataType >> 8) & Statics.OutTypeMask); this.tags = tags; this.fixedCount = fixedCount; this.custom = custom; if (countFlags != 0) { if (coreType == (int)TraceLoggingDataType.Nil) { throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfNil")); } if (coreType == (int)TraceLoggingDataType.Binary) { throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfBinary")); } #if !BROKEN_UNTIL_M3 if (coreType == (int)TraceLoggingDataType.Utf16String || coreType == (int)TraceLoggingDataType.MbcsString) { throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfNullTerminatedString")); } #endif } if (((int)this.tags & 0xfffffff) != 0) { this.outType |= Statics.OutTypeChainFlag; } if (this.outType != 0) { this.inType |= Statics.InTypeChainFlag; } }
public FieldMetadata(string name, TraceLoggingDataType type, EventFieldTags tags, byte[] custom) : this(name, type, tags, (byte)96, custom == null ? (ushort)0 : checked ((ushort)custom.Length), custom) { }
public FieldMetadata(string name, TraceLoggingDataType type, EventFieldTags tags, ushort fixedCount) : this(name, type, tags, (byte)32, fixedCount, (byte[])null) { }
public FieldMetadata(string name, TraceLoggingDataType type, EventFieldTags tags, bool variableCount) : this(name, type, tags, variableCount ? (byte)64 : (byte)0, (ushort)0, (byte[])null) { }
// Token: 0x0600351F RID: 13599 RVA: 0x000CE006 File Offset: 0x000CC206 public FieldMetadata(string name, TraceLoggingDataType type, EventFieldTags tags, bool variableCount) : this(name, type, tags, variableCount ? 64 : 0, 0, null) { }