88 writes to _tokenType
System.Text.Json (88)
System\Text\Json\Writer\Utf8JsonWriter.cs (11)
375_tokenType = default; 559_tokenType = JsonTokenType.StartArray; 572_tokenType = JsonTokenType.StartObject; 709_tokenType = JsonTokenType.StartArray; 723_tokenType = JsonTokenType.StartObject; 760_tokenType = JsonTokenType.StartArray; 785_tokenType = JsonTokenType.StartObject; 915_tokenType = JsonTokenType.StartArray; 940_tokenType = JsonTokenType.StartObject; 1005_tokenType = JsonTokenType.EndArray; 1017_tokenType = JsonTokenType.EndObject;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (3)
28_tokenType = JsonTokenType.String; 78_tokenType = JsonTokenType.String; 102_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (3)
32_tokenType = JsonTokenType.String; 84_tokenType = JsonTokenType.String; 109_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (3)
31_tokenType = JsonTokenType.String; 83_tokenType = JsonTokenType.String; 108_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (3)
31_tokenType = JsonTokenType.Number; 83_tokenType = JsonTokenType.Number; 108_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (3)
33_tokenType = JsonTokenType.Number; 86_tokenType = JsonTokenType.Number; 112_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (3)
33_tokenType = JsonTokenType.Number; 86_tokenType = JsonTokenType.Number; 112_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (3)
38_tokenType = JsonTokenType.Number; 68_tokenType = JsonTokenType.Number; 79_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (3)
31_tokenType = JsonTokenType.String; 83_tokenType = JsonTokenType.String; 108_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (9)
23_tokenType = JsonTokenType.Null; 34_tokenType = JsonTokenType.Null; 45_tokenType = JsonTokenType.Null; 105_tokenType = JsonTokenType.Null; 130_tokenType = JsonTokenType.Null; 146_tokenType = JsonTokenType.True; 151_tokenType = JsonTokenType.False; 204_tokenType = value ? JsonTokenType.True : JsonTokenType.False; 230_tokenType = value ? JsonTokenType.True : JsonTokenType.False;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (3)
31_tokenType = JsonTokenType.Number; 83_tokenType = JsonTokenType.Number; 108_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (14)
38_tokenType = JsonTokenType.PropertyName; 50_tokenType = JsonTokenType.PropertyName; 109_tokenType = JsonTokenType.PropertyName; 258_tokenType = JsonTokenType.PropertyName; 268_tokenType = JsonTokenType.PropertyName; 436_tokenType = JsonTokenType.String; 526_tokenType = JsonTokenType.String; 550_tokenType = JsonTokenType.String; 622_tokenType = JsonTokenType.String; 672_tokenType = JsonTokenType.String; 712_tokenType = JsonTokenType.String; 762_tokenType = JsonTokenType.String; 802_tokenType = JsonTokenType.String; 874_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (3)
32_tokenType = JsonTokenType.Number; 86_tokenType = JsonTokenType.Number; 112_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (1)
29_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (1)
39_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (1)
40_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (1)
39_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (1)
43_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (1)
43_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (1)
44_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (1)
39_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (3)
21_tokenType = JsonTokenType.Null; 36_tokenType = JsonTokenType.True; 41_tokenType = JsonTokenType.False;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (4)
161_tokenType = JsonTokenType.String; 168_tokenType = reader.TokenType; 252_tokenType = JsonTokenType.String; 259_tokenType = reader.TokenType;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (1)
52_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (4)
26_tokenType = JsonTokenType.String; 79_tokenType = JsonTokenType.String; 226_tokenType = JsonTokenType.String; 364_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (3)
60_tokenType = JsonTokenType.String; 228_tokenType = JsonTokenType.String; 395_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (1)
54_tokenType = JsonTokenType.Number;
119 references to _tokenType
System.Text.Json (119)
System\Text\Json\Writer\Utf8JsonWriter.cs (14)
110internal JsonTokenType TokenType => _tokenType; 655Debug.Assert(_tokenType != JsonTokenType.PropertyName); 656Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 661Debug.Assert(_tokenType != JsonTokenType.PropertyName); 662Debug.Assert(_tokenType != JsonTokenType.StartObject); 663Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 688if (_tokenType is not JsonTokenType.PropertyName and not JsonTokenType.None || _commentAfterNoneOrPropertyName) 1074if (_tokenType == JsonTokenType.PropertyName) 1101if (_tokenType == JsonTokenType.StartObject || _tokenType == JsonTokenType.StartArray) 1118Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); 1246=> ThrowHelper.ThrowInvalidOperationException(resource, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); 1251=> ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, maxDepth: _options.MaxDepth, token, _tokenType);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (4)
305Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 307if (_tokenType != JsonTokenType.None) 355Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 357if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (4)
307Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 309if (_tokenType != JsonTokenType.None) 355Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 357if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (4)
306Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 308if (_tokenType != JsonTokenType.None) 354Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 356if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (4)
300Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 302if (_tokenType != JsonTokenType.None) 345Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 347if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (4)
304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 306if (_tokenType != JsonTokenType.None) 349Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 351if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (4)
304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 306if (_tokenType != JsonTokenType.None) 349Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 351if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (4)
308Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 310if (_tokenType != JsonTokenType.None) 357Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 359if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (9)
40if (_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName) 42Debug.Assert(_tokenType != JsonTokenType.StartObject); 53if (_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName) 55Debug.Assert(_tokenType != JsonTokenType.StartObject); 71Debug.Assert(_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName); 125Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 127if (_tokenType != JsonTokenType.None) 198Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 200if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (4)
451Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 453if (_tokenType != JsonTokenType.None) 496Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 498if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (4)
376Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 378if (_tokenType != JsonTokenType.None) 421Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 423if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (11)
211if (_tokenType != JsonTokenType.None) 398Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 400if (_tokenType != JsonTokenType.None) 1537Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1539if (_tokenType != JsonTokenType.None) 1586Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1588if (_tokenType != JsonTokenType.None) 1638Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1640if (_tokenType != JsonTokenType.None) 1689Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1691if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (4)
385Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 387if (_tokenType != JsonTokenType.None) 430Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 432if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (2)
121if (_tokenType != JsonTokenType.PropertyName) 123if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (4)
56if (_tokenType is JsonTokenType.PropertyName or JsonTokenType.None) 130if (_tokenType != JsonTokenType.None || _commentAfterNoneOrPropertyName) 178if (_tokenType is JsonTokenType.PropertyName or JsonTokenType.None) 236if (_tokenType != JsonTokenType.None || _commentAfterNoneOrPropertyName)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (2)
86if (_tokenType != JsonTokenType.PropertyName) 88if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (2)
87if (_tokenType != JsonTokenType.PropertyName) 89if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (2)
82if (_tokenType != JsonTokenType.PropertyName) 84if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (2)
86if (_tokenType != JsonTokenType.PropertyName) 88if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (2)
86if (_tokenType != JsonTokenType.PropertyName) 88if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (2)
88if (_tokenType != JsonTokenType.PropertyName) 90if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (2)
87if (_tokenType != JsonTokenType.PropertyName) 89if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (13)
22/// <see cref="EnclosingContainerType.Object"/>: Writing a value is allowed only if <see cref="_tokenType"/> is a property name. 26/// <see cref="EnclosingContainerType.None"/>: Writing a value is allowed only if <see cref="_tokenType"/> is None (only one value may be written at the root). 36private bool CanWriteValue => _enclosingContainer == EnclosingContainerType.Array | (byte)_enclosingContainer == (byte)_tokenType; 65Debug.Assert(_tokenType != JsonTokenType.PropertyName); 66Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 71Debug.Assert(_tokenType != JsonTokenType.PropertyName); 72Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 105Debug.Assert(_tokenType != JsonTokenType.PropertyName); 106Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 111Debug.Assert(_tokenType != JsonTokenType.PropertyName); 112Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (2)
106if (_tokenType != JsonTokenType.PropertyName) 108if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (2)
95if (_tokenType != JsonTokenType.PropertyName) 97if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (4)
166if (_tokenType != JsonTokenType.PropertyName) 168if (_tokenType != JsonTokenType.None) 312if (_tokenType != JsonTokenType.PropertyName) 314if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (2)
492if (_tokenType != JsonTokenType.PropertyName) 494if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (2)
97if (_tokenType != JsonTokenType.PropertyName) 99if (_tokenType != JsonTokenType.None)