440 references to TokenType
Aspire.Dashboard (1)
Components\Dialogs\TextVisualizerDialog.razor.cs (1)
196
switch (reader.
TokenType
)
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
539
if (reader.
TokenType
== JsonTokenType.PropertyName)
Microsoft.AspNetCore.Components.Server (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
23
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndObject)
25
if (reader.
TokenType
== JsonTokenType.PropertyName)
39
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}.");
Microsoft.AspNetCore.Components.WebAssembly (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
23
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndObject)
25
if (reader.
TokenType
== JsonTokenType.PropertyName)
39
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}.");
Microsoft.AspNetCore.Components.WebView (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
23
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndObject)
25
if (reader.
TokenType
== JsonTokenType.PropertyName)
39
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}.");
Microsoft.AspNetCore.Grpc.JsonTranscoding (11)
Internal\Json\DurationConverter.cs (1)
20
if (reader.
TokenType
!= JsonTokenType.String)
Internal\Json\EnumConverter.cs (2)
21
switch (reader.
TokenType
)
43
throw new InvalidOperationException($"Unexpected JSON token: {reader.
TokenType
}.");
Internal\Json\FieldMaskConverter.cs (1)
24
if (reader.
TokenType
!= JsonTokenType.String)
Internal\Json\Int64Converter.cs (1)
18
if (reader.
TokenType
== JsonTokenType.String)
Internal\Json\NullValueConverter.cs (2)
17
switch (reader.
TokenType
)
33
throw new InvalidOperationException($"Unexpected JSON token: {reader.
TokenType
}");
Internal\Json\TimestampConverter.cs (1)
20
if (reader.
TokenType
!= JsonTokenType.String)
Internal\Json\UInt64Converter.cs (1)
19
if (reader.
TokenType
== JsonTokenType.String)
Internal\Json\ValueConverter.cs (2)
23
switch (reader.
TokenType
)
57
throw new InvalidOperationException("Unexpected token type: " + reader.
TokenType
);
Microsoft.AspNetCore.Http.Connections.Common (17)
NegotiateProtocol.cs (8)
167
switch (reader.
TokenType
)
198
if (reader.
TokenType
== JsonTokenType.StartObject)
202
else if (reader.
TokenType
== JsonTokenType.EndArray)
229
throw new InvalidDataException($"Unexpected token '{reader.
TokenType
}' when reading negotiation response JSON.");
279
switch (reader.
TokenType
)
296
switch (reader.
TokenType
)
305
throw new InvalidDataException($"Unexpected token '{reader.
TokenType
}' when reading transfer formats JSON.");
327
throw new InvalidDataException($"Unexpected token '{reader.
TokenType
}' when reading available transport JSON.");
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23
if (reader.
TokenType
!= JsonTokenType.StartObject)
31
return GetTokenString(reader.
TokenType
);
54
if (reader.
TokenType
!= JsonTokenType.StartArray)
64
return reader.
TokenType
switch
76
if (reader.
TokenType
!= JsonTokenType.String)
88
if (reader.
TokenType
== JsonTokenType.Null)
93
if (reader.
TokenType
!= JsonTokenType.Number)
105
if (reader.
TokenType
== JsonTokenType.Null)
110
if (reader.
TokenType
!= JsonTokenType.Number)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\SharedTypes.cs (1)
990
if (reader.
TokenType
== JsonTokenType.EndObject)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
990
if (reader.
TokenType
== JsonTokenType.EndObject)
Microsoft.AspNetCore.OpenApi (22)
Schemas\OpenApiJsonSchema.cs (2)
21
if (reader.
TokenType
!= JsonTokenType.StartObject)
28
switch (reader.
TokenType
)
Schemas\OpenApiJsonSchema.Helpers.cs (20)
22
if (reader.
TokenType
== JsonTokenType.Null)
27
if (reader.
TokenType
== JsonTokenType.StartArray)
31
while (reader.
TokenType
!= JsonTokenType.EndArray)
40
if (reader.
TokenType
== JsonTokenType.Null)
57
if (reader.
TokenType
== JsonTokenType.Null)
62
if (reader.
TokenType
!= JsonTokenType.StartObject)
69
while (reader.
TokenType
!= JsonTokenType.EndObject)
71
if (reader.
TokenType
!= JsonTokenType.PropertyName)
91
if (reader.
TokenType
== JsonTokenType.Null)
96
if (reader.
TokenType
== JsonTokenType.True || reader.
TokenType
== JsonTokenType.False)
102
if (reader.
TokenType
== JsonTokenType.Number)
129
if (reader.
TokenType
== JsonTokenType.String)
135
if (reader.
TokenType
== JsonTokenType.StartArray)
139
while (reader.
TokenType
!= JsonTokenType.EndArray)
147
if (reader.
TokenType
== JsonTokenType.StartObject)
152
while (reader.
TokenType
!= JsonTokenType.EndObject)
154
if (reader.
TokenType
!= JsonTokenType.PropertyName)
183
if (reader.
TokenType
== JsonTokenType.StartArray)
283
if (reader.
TokenType
== JsonTokenType.False)
Microsoft.AspNetCore.SignalR.Common (15)
Protocol\HandshakeProtocol.cs (6)
133
if (reader.
TokenType
== JsonTokenType.PropertyName)
150
else if (reader.
TokenType
== JsonTokenType.EndObject)
156
throw new InvalidDataException($"Unexpected token '{reader.
TokenType
}' when reading handshake response JSON.");
188
if (reader.
TokenType
== JsonTokenType.PropertyName)
203
else if (reader.
TokenType
== JsonTokenType.EndObject)
209
throw new InvalidDataException($"Unexpected token '{reader.
TokenType
}' when reading handshake request JSON. Message content: {GetPayloadAsString()}");
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23
if (reader.
TokenType
!= JsonTokenType.StartObject)
31
return GetTokenString(reader.
TokenType
);
54
if (reader.
TokenType
!= JsonTokenType.StartArray)
64
return reader.
TokenType
switch
76
if (reader.
TokenType
!= JsonTokenType.String)
88
if (reader.
TokenType
== JsonTokenType.Null)
93
if (reader.
TokenType
!= JsonTokenType.Number)
105
if (reader.
TokenType
== JsonTokenType.Null)
110
if (reader.
TokenType
!= JsonTokenType.Number)
Microsoft.AspNetCore.SignalR.Protocols.Json (19)
Protocol\JsonHubProtocol.cs (10)
155
switch (reader.
TokenType
)
175
if (reader.
TokenType
!= JsonTokenType.StartArray)
183
while (reader.
TokenType
!= JsonTokenType.EndArray)
197
if (reader.
TokenType
!= JsonTokenType.String)
291
if (reader.
TokenType
!= JsonTokenType.StartArray)
318
while (reader.CurrentDepth == initialDepth && reader.
TokenType
== JsonTokenType.StartArray ||
485
if (reader.
TokenType
!= JsonTokenType.StartObject)
492
switch (reader.
TokenType
)
499
if (reader.
TokenType
!= JsonTokenType.String)
841
while (reader.
TokenType
!= JsonTokenType.EndArray && reader.CurrentDepth > depth)
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23
if (reader.
TokenType
!= JsonTokenType.StartObject)
31
return GetTokenString(reader.
TokenType
);
54
if (reader.
TokenType
!= JsonTokenType.StartArray)
64
return reader.
TokenType
switch
76
if (reader.
TokenType
!= JsonTokenType.String)
88
if (reader.
TokenType
== JsonTokenType.Null)
93
if (reader.
TokenType
!= JsonTokenType.Number)
105
if (reader.
TokenType
== JsonTokenType.Null)
110
if (reader.
TokenType
!= JsonTokenType.Number)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (9)
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23
if (reader.
TokenType
!= JsonTokenType.StartObject)
31
return GetTokenString(reader.
TokenType
);
54
if (reader.
TokenType
!= JsonTokenType.StartArray)
64
return reader.
TokenType
switch
76
if (reader.
TokenType
!= JsonTokenType.String)
88
if (reader.
TokenType
== JsonTokenType.Null)
93
if (reader.
TokenType
!= JsonTokenType.Number)
105
if (reader.
TokenType
== JsonTokenType.Null)
110
if (reader.
TokenType
!= JsonTokenType.Number)
Microsoft.CodeAnalysis.LanguageServer.Protocol (34)
Protocol\Converters\FormattingOptionsConverter.cs (8)
23
Debug.Assert(reader.
TokenType
== JsonTokenType.StartObject);
34
while (reader.
TokenType
== JsonTokenType.Comment);
54
if (reader.
TokenType
== JsonTokenType.EndObject)
67
if (reader.
TokenType
== JsonTokenType.Comment)
72
if (reader.
TokenType
!= JsonTokenType.PropertyName)
74
throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.FormattingOptionsEncounteredInvalidToken, reader.
TokenType
));
102
SumType<bool, int, string> value = reader.
TokenType
switch
108
_ => throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.FormattingOptionsEncounteredInvalidToken, reader.
TokenType
))
Protocol\Converters\NaturalObjectConverter.cs (2)
34
switch (reader.
TokenType
)
59
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndArray)
Protocol\Converters\StringEnumConverter.cs (2)
40
if (reader.
TokenType
== JsonTokenType.String)
44
else if (reader.
TokenType
== JsonTokenType.Null)
Protocol\Converters\SumConverter.cs (3)
188
if (reader.
TokenType
== JsonTokenType.Null)
198
var applicableUnionTypeInfos = sumTypeInfoCache.GetApplicableInfos(reader.
TokenType
);
279
switch (reader.
TokenType
)
Protocol\Converters\TextDocumentSyncConverter.cs (3)
16
if (reader.
TokenType
== JsonTokenType.Number)
31
else if (reader.
TokenType
== JsonTokenType.String)
36
else if (reader.
TokenType
== JsonTokenType.StartObject)
Protocol\Internal\Converters\ClassifiedTextElementConverter.cs (3)
22
if (reader.
TokenType
== JsonTokenType.EndObject)
27
if (reader.
TokenType
== JsonTokenType.PropertyName)
36
if (reader.
TokenType
== JsonTokenType.EndArray)
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (1)
17
if (reader.
TokenType
== JsonTokenType.StartObject)
Protocol\Internal\Converters\ContainerElementConverter.cs (4)
21
if (reader.
TokenType
== JsonTokenType.StartObject)
28
if (reader.
TokenType
== JsonTokenType.EndObject)
33
if (reader.
TokenType
== JsonTokenType.PropertyName)
42
if (reader.
TokenType
== JsonTokenType.EndArray)
Protocol\Internal\Converters\ImageElementConverter.cs (3)
18
if (reader.
TokenType
== JsonTokenType.StartObject)
25
if (reader.
TokenType
== JsonTokenType.EndObject)
31
if (reader.
TokenType
== JsonTokenType.PropertyName)
Protocol\Internal\Converters\ImageIdConverter.cs (1)
17
if (reader.
TokenType
== JsonTokenType.StartObject)
Protocol\Internal\Converters\ObjectContentConverter.cs (4)
40
if (reader.
TokenType
== JsonTokenType.Null)
45
else if (reader.
TokenType
== JsonTokenType.StartObject)
68
else if (reader.
TokenType
== JsonTokenType.String)
72
else if (reader.
TokenType
== JsonTokenType.Number)
Microsoft.Extensions.DependencyModel (15)
Utf8JsonReaderExtensions.cs (15)
16
=> reader.
TokenType
== JsonTokenType.PropertyName;
28
if (reader.
TokenType
== JsonTokenType.String)
52
if (reader.
TokenType
!= JsonTokenType.StartObject)
60
if (reader.
TokenType
!= JsonTokenType.EndObject)
69
if (reader.
TokenType
!= JsonTokenType.StartArray)
76
while (reader.Read() && reader.
TokenType
== JsonTokenType.String)
81
if (reader.
TokenType
!= JsonTokenType.EndArray)
93
if (reader.
TokenType
== JsonTokenType.Null)
97
if (reader.
TokenType
!= JsonTokenType.String)
109
if (reader.
TokenType
== JsonTokenType.Null)
113
if (reader.
TokenType
!= JsonTokenType.True && reader.
TokenType
!= JsonTokenType.False)
124
if (reader.
TokenType
== JsonTokenType.Null)
128
if (reader.
TokenType
!= JsonTokenType.True && reader.
TokenType
!= JsonTokenType.False)
Microsoft.JSInterop (26)
Implementation\JSObjectReferenceJsonWorker.cs (3)
27
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndObject)
29
if (reader.
TokenType
== JsonTokenType.PropertyName)
43
throw new JsonException($"Unexpected JSON token {reader.
TokenType
}");
Infrastructure\ByteArrayJsonConverter.cs (9)
26
if (reader.
TokenType
== JsonTokenType.String && reader.TryGetBytesFromBase64(out var bytes))
38
if (reader.
TokenType
!= JsonTokenType.StartObject)
40
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}, expected 'StartObject'.");
43
if (reader.Read() && reader.
TokenType
== JsonTokenType.PropertyName)
49
else if (!reader.Read() || reader.
TokenType
!= JsonTokenType.Number)
51
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}, expected 'Number'.");
60
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}, expected 'PropertyName'.");
63
if (reader.Read() && reader.
TokenType
!= JsonTokenType.EndObject)
65
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}, expected 'EndObject'.");
Infrastructure\DotNetDispatcher.cs (8)
230
if (!reader.Read() || reader.
TokenType
!= JsonTokenType.StartArray)
238
while (index < parameterTypes.Length && reader.Read() && reader.
TokenType
!= JsonTokenType.EndArray)
241
if (reader.
TokenType
== JsonTokenType.StartObject && IsIncorrectDotNetObjectRefUse(parameterType, reader))
256
if (!reader.Read() || reader.
TokenType
!= JsonTokenType.EndArray)
259
throw new JsonException($"Unexpected JSON token {reader.
TokenType
}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters.");
271
jsonReader.
TokenType
== JsonTokenType.PropertyName &&
317
if (!reader.Read() || reader.
TokenType
!= JsonTokenType.StartArray)
334
if (!reader.Read() || reader.
TokenType
!= JsonTokenType.EndArray)
Infrastructure\DotNetObjectReferenceJsonConverter.cs (3)
26
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndObject)
28
if (reader.
TokenType
== JsonTokenType.PropertyName)
42
throw new JsonException($"Unexpected JSON Token {reader.
TokenType
}.");
Infrastructure\JSStreamReferenceJsonConverter.cs (3)
29
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndObject)
31
if (reader.
TokenType
== JsonTokenType.PropertyName)
50
throw new JsonException($"Unexpected JSON token {reader.
TokenType
}");
Microsoft.ML.SearchSpace (3)
Converter\ParameterConverter.cs (3)
17
switch (reader.
TokenType
)
43
while (reader.Read() && reader.
TokenType
!= JsonTokenType.EndArray)
50
throw new ArgumentException($"Unsupported reader type {reader.
TokenType
}");
Microsoft.ML.Tokenizers (2)
Utils\StringSpanOrdinalKey.cs (2)
153
if (reader.
TokenType
== JsonTokenType.EndObject)
158
if (reader.
TokenType
== JsonTokenType.PropertyName)
System.Text.Json (252)
System\Text\Json\Document\JsonDocument.cs (1)
964
JsonTokenType tokenType = reader.
TokenType
;
System\Text\Json\Document\JsonDocument.Parse.cs (8)
352
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
392
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
444
switch (reader.
TokenType
)
472
switch (reader.
TokenType
)
509
reader.
TokenType
== JsonTokenType.EndObject ||
510
reader.
TokenType
== JsonTokenType.EndArray);
532
document = CreateForLiteral(reader.
TokenType
);
666
document = ParseUnrented(owned, state.Options, reader.
TokenType
);
System\Text\Json\Document\JsonElement.Parse.cs (2)
21
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
86
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
System\Text\Json\JsonHelpers.cs (3)
23
Debug.Assert(reader.
TokenType
is JsonTokenType.String or JsonTokenType.PropertyName);
86
JsonTokenType tokenType = reader.
TokenType
;
104
Debug.Assert(tokenType == reader.
TokenType
);
System\Text\Json\Nodes\JsonNode.Parse.cs (1)
24
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (1)
60
return JsonReaderHelper.ToValueKind(reader.
TokenType
);
System\Text\Json\Reader\Utf8JsonReader.cs (19)
110
if (
TokenType
is JsonTokenType.StartArray or JsonTokenType.StartObject)
284
if (_isFinalBlock &&
TokenType
is JsonTokenType.None && !_readerOptions.AllowMultipleValues)
303
/// When <see cref="
TokenType
"/> is <see cref="JsonTokenType.PropertyName" />, the reader first moves to the property value.
304
/// When <see cref="
TokenType
"/> (originally, or after advancing) is <see cref="JsonTokenType.StartObject" /> or
326
if (
TokenType
is JsonTokenType.PropertyName)
334
if (
TokenType
is JsonTokenType.StartObject or JsonTokenType.StartArray)
362
/// When <see cref="
TokenType
"/> is <see cref="JsonTokenType.PropertyName" />, the reader first moves to the property value.
363
/// When <see cref="
TokenType
"/> (originally, or after advancing) is <see cref="JsonTokenType.StartObject" /> or
403
if (
TokenType
is JsonTokenType.PropertyName)
412
if (
TokenType
is not (JsonTokenType.StartObject or JsonTokenType.StartArray))
441
/// <seealso cref="
TokenType
" />
455
if (!IsTokenTypeString(
TokenType
))
457
ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(
TokenType
);
471
/// <seealso cref="
TokenType
" />
512
/// <seealso cref="
TokenType
" />
526
if (!IsTokenTypeString(
TokenType
))
528
ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(
TokenType
);
2563
=>
TokenType
switch
2577
_ => ((byte)
TokenType
).ToString()
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (74)
18
/// Returns <see langword="null" /> when <see cref="
TokenType
"/> is <see cref="JsonTokenType.Null"/>.
24
/// <seealso cref="
TokenType
" />
29
if (
TokenType
== JsonTokenType.Null)
34
if (
TokenType
!= JsonTokenType.String &&
TokenType
!= JsonTokenType.PropertyName)
36
ThrowHelper.ThrowInvalidOperationException_ExpectedString(
TokenType
);
65
/// <seealso cref="
TokenType
" />
129
/// <seealso cref="
TokenType
" />
237
/// <seealso cref="
TokenType
" />
241
if (
TokenType
!= JsonTokenType.Comment)
243
ThrowHelper.ThrowInvalidOperationException_ExpectedComment(
TokenType
);
255
/// <seealso cref="
TokenType
" />
259
JsonTokenType type =
TokenType
;
267
ThrowHelper.ThrowInvalidOperationException_ExpectedBoolean(
TokenType
);
280
/// <seealso cref="
TokenType
" />
303
/// <seealso cref="
TokenType
" />
337
/// <seealso cref="
TokenType
" />
372
/// <seealso cref="
TokenType
" />
406
/// <seealso cref="
TokenType
" />
440
/// <seealso cref="
TokenType
" />
474
/// <seealso cref="
TokenType
" />
509
/// <seealso cref="
TokenType
" />
544
/// <seealso cref="
TokenType
" />
579
/// <seealso cref="
TokenType
" />
636
/// <seealso cref="
TokenType
" />
693
/// <seealso cref="
TokenType
" />
726
/// <seealso cref="
TokenType
" />
759
/// <seealso cref="
TokenType
" />
792
/// <seealso cref="
TokenType
" />
825
/// <seealso cref="
TokenType
" />
829
if (
TokenType
!= JsonTokenType.String)
831
ThrowHelper.ThrowInvalidOperationException_ExpectedString(
TokenType
);
853
/// <seealso cref="
TokenType
" />
857
if (
TokenType
!= JsonTokenType.Number)
859
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
888
/// <seealso cref="
TokenType
" />
893
if (
TokenType
!= JsonTokenType.Number)
895
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
924
/// <seealso cref="
TokenType
" />
928
if (
TokenType
!= JsonTokenType.Number)
930
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
959
/// <seealso cref="
TokenType
" />
963
if (
TokenType
!= JsonTokenType.Number)
965
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
994
/// <seealso cref="
TokenType
" />
998
if (
TokenType
!= JsonTokenType.Number)
1000
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
1029
/// <seealso cref="
TokenType
" />
1034
if (
TokenType
!= JsonTokenType.Number)
1036
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
1065
/// <seealso cref="
TokenType
" />
1070
if (
TokenType
!= JsonTokenType.Number)
1072
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
1101
/// <seealso cref="
TokenType
" />
1106
if (
TokenType
!= JsonTokenType.Number)
1108
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
1137
/// <seealso cref="
TokenType
" />
1141
if (
TokenType
!= JsonTokenType.Number)
1143
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
1167
/// <seealso cref="
TokenType
" />
1171
if (
TokenType
!= JsonTokenType.Number)
1173
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
1197
/// <seealso cref="
TokenType
" />
1201
if (
TokenType
!= JsonTokenType.Number)
1203
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(
TokenType
);
1232
/// <seealso cref="
TokenType
" />
1236
if (
TokenType
!= JsonTokenType.String)
1238
ThrowHelper.ThrowInvalidOperationException_ExpectedString(
TokenType
);
1297
/// <seealso cref="
TokenType
" />
1301
if (
TokenType
!= JsonTokenType.String)
1303
ThrowHelper.ThrowInvalidOperationException_ExpectedString(
TokenType
);
1363
/// <seealso cref="
TokenType
" />
1367
if (
TokenType
!= JsonTokenType.String)
1369
ThrowHelper.ThrowInvalidOperationException_ExpectedString(
TokenType
);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (9)
75
if (reader.
TokenType
!= JsonTokenType.StartArray)
92
if (reader.
TokenType
== JsonTokenType.EndArray)
108
if (reader.
TokenType
== JsonTokenType.EndArray)
124
if (reader.
TokenType
== JsonTokenType.StartArray)
130
if (reader.
TokenType
!= JsonTokenType.StartObject)
217
if (reader.
TokenType
== JsonTokenType.EndArray)
264
if (reader.
TokenType
!= JsonTokenType.EndObject)
266
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
272
Debug.Assert(reader.
TokenType
is JsonTokenType.EndObject);
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (8)
87
if (reader.
TokenType
!= JsonTokenType.StartObject)
107
if (reader.
TokenType
== JsonTokenType.EndObject)
113
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
133
if (reader.
TokenType
== JsonTokenType.EndObject)
139
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
157
if (reader.
TokenType
!= JsonTokenType.StartObject)
240
if (reader.
TokenType
== JsonTokenType.EndObject)
246
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Collection\MemoryConverter.cs (1)
21
if (reader.
TokenType
is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Collection\ReadOnlyMemoryConverter.cs (1)
21
if (reader.
TokenType
is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\FSharp\FSharpOptionConverter.cs (2)
36
if (!state.IsContinuation && reader.
TokenType
== JsonTokenType.Null)
85
if (reader.
TokenType
== JsonTokenType.Null)
System\Text\Json\Serialization\Converters\FSharp\FSharpValueOptionConverter.cs (2)
36
if (!state.IsContinuation && reader.
TokenType
== JsonTokenType.Null)
87
if (reader.
TokenType
== JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (2)
25
switch (reader.
TokenType
)
33
throw ThrowHelper.GetInvalidOperationException_ExpectedArray(reader.
TokenType
);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
41
switch (reader.
TokenType
)
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (2)
50
switch (reader.
TokenType
)
58
throw ThrowHelper.GetInvalidOperationException_ExpectedObject(reader.
TokenType
);
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (1)
25
if (reader.
TokenType
is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (4)
30
if (reader.
TokenType
!= JsonTokenType.StartObject)
60
if (reader.
TokenType
!= JsonTokenType.StartObject)
165
JsonTokenType tokenType = reader.
TokenType
;
282
JsonTokenType tokenType = reader.
TokenType
;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (5)
43
if (reader.
TokenType
!= JsonTokenType.StartObject)
94
Debug.Assert(tempReader.
TokenType
== JsonTokenType.PropertyName);
123
if (reader.
TokenType
!= JsonTokenType.StartObject)
292
JsonTokenType tokenType = reader.
TokenType
;
402
JsonTokenType tokenType = reader.
TokenType
;
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
25
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\ByteArrayConverter.cs (1)
12
if (reader.
TokenType
== JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (2)
29
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
40
if (reader.
TokenType
== JsonTokenType.String && (JsonNumberHandling.AllowReadingFromString & handling) != 0)
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (5)
15
if (reader.
TokenType
is not (JsonTokenType.String or JsonTokenType.PropertyName))
17
ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.
TokenType
);
22
ThrowHelper.ThrowInvalidOperationException_ExpectedChar(reader.
TokenType
);
30
ThrowHelper.ThrowInvalidOperationException_ExpectedChar(reader.
TokenType
);
49
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
17
if (reader.
TokenType
!= JsonTokenType.String)
19
ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.
TokenType
);
27
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
23
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
23
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (2)
28
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
39
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (2)
29
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
40
if (reader.
TokenType
== JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (2)
104
switch (reader.
TokenType
)
238
Debug.Assert(reader.
TokenType
is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
24
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (4)
23
if (reader.
TokenType
!= JsonTokenType.Number)
25
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.
TokenType
);
74
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
87
if (reader.
TokenType
== JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (4)
23
if (reader.
TokenType
!= JsonTokenType.Number)
25
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.
TokenType
);
68
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
81
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (2)
30
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
41
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (2)
30
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
41
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (2)
29
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
40
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (2)
28
if (reader.
TokenType
!= JsonTokenType.PropertyName)
30
ThrowHelper.ThrowInvalidOperationException_ExpectedPropertyName(reader.
TokenType
);
System\Text\Json\Serialization\Converters\Value\MemoryByteConverter.cs (1)
15
return reader.
TokenType
is JsonTokenType.Null ? default : reader.GetBytesFromBase64();
System\Text\Json\Serialization\Converters\Value\NullableConverter.cs (3)
30
if (!state.IsContinuation && reader.
TokenType
== JsonTokenType.Null)
64
if (reader.
TokenType
== JsonTokenType.Null)
87
if (reader.
TokenType
== JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Value\ReadOnlyMemoryByteConverter.cs (1)
15
return reader.
TokenType
is JsonTokenType.Null ? default : reader.GetBytesFromBase64();
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (2)
29
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
40
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (2)
30
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
41
if (reader.
TokenType
== JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
32
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (4)
19
if (reader.
TokenType
!= JsonTokenType.String)
21
ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.
TokenType
);
29
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
35
Debug.Assert(reader.
TokenType
is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (4)
19
if (reader.
TokenType
!= JsonTokenType.String)
21
ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.
TokenType
);
29
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
35
Debug.Assert(reader.
TokenType
is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (4)
23
if (reader.
TokenType
!= JsonTokenType.Number)
25
ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.
TokenType
);
68
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
81
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (2)
30
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
41
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (2)
30
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
41
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (2)
29
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
40
if (reader.
TokenType
== JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (2)
14
return reader.
TokenType
is JsonTokenType.Null ? null : ReadCore(ref reader);
30
Debug.Assert(reader.
TokenType
is JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (4)
22
if (reader.
TokenType
is JsonTokenType.Null)
27
if (reader.
TokenType
!= JsonTokenType.String)
29
ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.
TokenType
);
37
Debug.Assert(reader.
TokenType
is JsonTokenType.PropertyName or JsonTokenType.String);
System\Text\Json\Serialization\JsonConverterOfT.cs (7)
151
if (reader.
TokenType
== JsonTokenType.Null && !HandleNullOnRead && !state.IsContinuation)
183
JsonTokenType originalPropertyTokenType = reader.
TokenType
;
242
state.Current.OriginalTokenType = reader.
TokenType
;
506
if (reader.
TokenType
!= JsonTokenType.EndArray)
518
if (reader.
TokenType
!= JsonTokenType.EndObject)
553
Debug.Assert(reader.
TokenType
== tokenType);
605
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (12)
67
if (reader.
TokenType
== JsonTokenType.EndObject)
74
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
214
if (reader.
TokenType
!= JsonTokenType.String)
216
ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.
TokenType
);
228
if (reader.
TokenType
!= JsonTokenType.String)
230
ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.
TokenType
);
244
switch (reader.
TokenType
)
253
ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.
TokenType
);
261
if (reader.
TokenType
!= JsonTokenType.StartArray)
263
ThrowHelper.ThrowJsonException_MetadataValuesInvalidToken(reader.
TokenType
);
494
switch (reader.
TokenType
)
509
Debug.Assert(reader.
TokenType
== JsonTokenType.PropertyName);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (8)
35
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
89
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
140
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
189
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
250
/// If the <see cref="Utf8JsonReader.
TokenType
"/> property of <paramref name="reader"/>
345
switch (reader.
TokenType
)
363
switch (reader.
TokenType
)
389
Debug.Assert(reader.
TokenType
is JsonTokenType.EndObject or JsonTokenType.EndArray);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
857
if (reader.
TokenType
== JsonTokenType.Null)
906
if (JsonTypeInfo.ElementType == JsonTypeInfo.ObjectType && reader.
TokenType
== JsonTokenType.Null)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (2)
279
bool isNullToken = reader.
TokenType
== JsonTokenType.Null;
368
bool isNullToken = reader.
TokenType
== JsonTokenType.Null;
System\Text\Json\ThrowHelper.cs (1)
438
message = SR.Format(SR.InvalidEndOfJsonNonPrimitive, json.
TokenType
);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
168
_tokenType = reader.
TokenType
;
259
_tokenType = reader.
TokenType
;
System.Windows.Forms.Tests (2)
System\Windows\Forms\DataObjectTests.cs (2)
2934
if (reader.
TokenType
== JsonTokenType.EndObject)
2945
if (reader.
TokenType
!= JsonTokenType.PropertyName)