Editar

Compartilhar via


Utf8JsonReader.TrySkip Method

Definition

Tries to skip the children of the current JSON token.

public:
 bool TrySkip();
public bool TrySkip ();
member this.TrySkip : unit -> bool
Public Function TrySkip () As Boolean

Returns

true if there was enough data for the children to be skipped successfully; otherwise, false.

Exceptions

An invalid JSON token was encountered while skipping, according to the JSON RFC.

-or -

The current depth exceeds the recursive limit set by the maximum depth.

Remarks

If the reader did not have enough data to completely skip the children of the current token, it will be reset to the state it was in before the method was called.

When TokenType is JsonTokenType.PropertyName, the reader first moves to the property value.

When TokenType (originally, or after advancing) is JsonTokenType.StartObject or JsonTokenType.StartArray, the reader advances to the matching JsonTokenType.EndObject or JsonTokenType.EndArray.

For all other token types, the reader does not move. After the next call to Read(), the reader will be at the next value (when in an array), the next property name (when in an object), or the end array/object token.

Applies to