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)
110
internal JsonTokenType TokenType =>
_tokenType
;
655
Debug.Assert(
_tokenType
!= JsonTokenType.PropertyName);
656
Debug.Assert(
_tokenType
!= JsonTokenType.None &&
_tokenType
!= JsonTokenType.StartArray);
661
Debug.Assert(
_tokenType
!= JsonTokenType.PropertyName);
662
Debug.Assert(
_tokenType
!= JsonTokenType.StartObject);
663
Debug.Assert(CurrentDepth == 0 &&
_tokenType
!= JsonTokenType.None);
688
if (
_tokenType
is not JsonTokenType.PropertyName and not JsonTokenType.None || _commentAfterNoneOrPropertyName)
1074
if (
_tokenType
== JsonTokenType.PropertyName)
1101
if (
_tokenType
== JsonTokenType.StartObject ||
_tokenType
== JsonTokenType.StartArray)
1118
Debug.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)
305
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
307
if (
_tokenType
!= JsonTokenType.None)
355
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
357
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (4)
307
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
309
if (
_tokenType
!= JsonTokenType.None)
355
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
357
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (4)
306
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
308
if (
_tokenType
!= JsonTokenType.None)
354
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
356
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (4)
300
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
302
if (
_tokenType
!= JsonTokenType.None)
345
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
347
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (4)
304
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
306
if (
_tokenType
!= JsonTokenType.None)
349
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
351
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (4)
304
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
306
if (
_tokenType
!= JsonTokenType.None)
349
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
351
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (4)
308
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
310
if (
_tokenType
!= JsonTokenType.None)
357
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
359
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (9)
40
if (_enclosingContainer != EnclosingContainerType.Object ||
_tokenType
== JsonTokenType.PropertyName)
42
Debug.Assert(
_tokenType
!= JsonTokenType.StartObject);
53
if (_enclosingContainer != EnclosingContainerType.Object ||
_tokenType
== JsonTokenType.PropertyName)
55
Debug.Assert(
_tokenType
!= JsonTokenType.StartObject);
71
Debug.Assert(_enclosingContainer != EnclosingContainerType.Object ||
_tokenType
== JsonTokenType.PropertyName);
125
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
127
if (
_tokenType
!= JsonTokenType.None)
198
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
200
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (4)
451
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
453
if (
_tokenType
!= JsonTokenType.None)
496
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
498
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (4)
376
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
378
if (
_tokenType
!= JsonTokenType.None)
421
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
423
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (11)
211
if (
_tokenType
!= JsonTokenType.None)
398
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
400
if (
_tokenType
!= JsonTokenType.None)
1537
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
1539
if (
_tokenType
!= JsonTokenType.None)
1586
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
1588
if (
_tokenType
!= JsonTokenType.None)
1638
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
1640
if (
_tokenType
!= JsonTokenType.None)
1689
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
1691
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (4)
385
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
387
if (
_tokenType
!= JsonTokenType.None)
430
Debug.Assert(_options.SkipValidation ||
_tokenType
!= JsonTokenType.PropertyName);
432
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (2)
121
if (
_tokenType
!= JsonTokenType.PropertyName)
123
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (4)
56
if (
_tokenType
is JsonTokenType.PropertyName or JsonTokenType.None)
130
if (
_tokenType
!= JsonTokenType.None || _commentAfterNoneOrPropertyName)
178
if (
_tokenType
is JsonTokenType.PropertyName or JsonTokenType.None)
236
if (
_tokenType
!= JsonTokenType.None || _commentAfterNoneOrPropertyName)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (2)
86
if (
_tokenType
!= JsonTokenType.PropertyName)
88
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (2)
87
if (
_tokenType
!= JsonTokenType.PropertyName)
89
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (2)
82
if (
_tokenType
!= JsonTokenType.PropertyName)
84
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (2)
86
if (
_tokenType
!= JsonTokenType.PropertyName)
88
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (2)
86
if (
_tokenType
!= JsonTokenType.PropertyName)
88
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (2)
88
if (
_tokenType
!= JsonTokenType.PropertyName)
90
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (2)
87
if (
_tokenType
!= JsonTokenType.PropertyName)
89
if (
_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).
36
private bool CanWriteValue => _enclosingContainer == EnclosingContainerType.Array | (byte)_enclosingContainer == (byte)
_tokenType
;
65
Debug.Assert(
_tokenType
!= JsonTokenType.PropertyName);
66
Debug.Assert(
_tokenType
!= JsonTokenType.None &&
_tokenType
!= JsonTokenType.StartArray);
71
Debug.Assert(
_tokenType
!= JsonTokenType.PropertyName);
72
Debug.Assert(CurrentDepth == 0 &&
_tokenType
!= JsonTokenType.None);
105
Debug.Assert(
_tokenType
!= JsonTokenType.PropertyName);
106
Debug.Assert(
_tokenType
!= JsonTokenType.None &&
_tokenType
!= JsonTokenType.StartArray);
111
Debug.Assert(
_tokenType
!= JsonTokenType.PropertyName);
112
Debug.Assert(CurrentDepth == 0 &&
_tokenType
!= JsonTokenType.None);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (2)
106
if (
_tokenType
!= JsonTokenType.PropertyName)
108
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (2)
95
if (
_tokenType
!= JsonTokenType.PropertyName)
97
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (4)
166
if (
_tokenType
!= JsonTokenType.PropertyName)
168
if (
_tokenType
!= JsonTokenType.None)
312
if (
_tokenType
!= JsonTokenType.PropertyName)
314
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (2)
492
if (
_tokenType
!= JsonTokenType.PropertyName)
494
if (
_tokenType
!= JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (2)
97
if (
_tokenType
!= JsonTokenType.PropertyName)
99
if (
_tokenType
!= JsonTokenType.None)