10 writes to _enclosingContainer
System.Text.Json (10)
System\Text\Json\Writer\Utf8JsonWriter.cs (4)
374
_enclosingContainer
= default;
1095
_enclosingContainer
= _bitStack.CurrentDepth == 0 ? EnclosingContainerType.None : container;
1161
_enclosingContainer
= EnclosingContainerType.Array;
1167
_enclosingContainer
= EnclosingContainerType.Object;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (6)
39
_enclosingContainer
= EnclosingContainerType.Utf16StringSequence;
59
_enclosingContainer
= _bitStack.CurrentDepth == 0 ? EnclosingContainerType.None : container;
207
_enclosingContainer
= EnclosingContainerType.Utf8StringSequence;
227
_enclosingContainer
= _bitStack.CurrentDepth == 0 ? EnclosingContainerType.None : container;
374
_enclosingContainer
= EnclosingContainerType.Base64StringSequence;
394
_enclosingContainer
= _bitStack.CurrentDepth == 0 ? EnclosingContainerType.None : container;
24 references to _enclosingContainer
System.Text.Json (24)
System\Text\Json\Writer\Utf8JsonWriter.cs (7)
125
Debug.Assert(
_enclosingContainer
== EnclosingContainerType.Utf8StringSequence);
154
Debug.Assert(
_enclosingContainer
== EnclosingContainerType.Utf16StringSequence);
182
Debug.Assert(
_enclosingContainer
== EnclosingContainerType.Base64StringSequence);
653
if (
_enclosingContainer
== EnclosingContainerType.Object)
1079
if (
_enclosingContainer
!= EnclosingContainerType.Array)
1088
if (
_enclosingContainer
!= EnclosingContainerType.Object)
1264
private bool IsWritingPartialString =>
_enclosingContainer
>= EnclosingContainerType.Utf8StringSequence;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (3)
40
if (
_enclosingContainer
!= EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName)
53
if (
_enclosingContainer
!= EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName)
71
Debug.Assert(
_enclosingContainer
!= EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (8)
16
/// Returns whether a JSON value can be written at the current position based on the current <see cref="
_enclosingContainer
"/>:
31
/// Writing a value is never valid and <see cref="
_enclosingContainer
"/> does not equal any <see cref="JsonTokenType"/> by construction.
36
private bool CanWriteValue =>
_enclosingContainer
== EnclosingContainerType.Array | (byte)
_enclosingContainer
== (byte)_tokenType;
63
if (
_enclosingContainer
== EnclosingContainerType.Object)
86
if (
_enclosingContainer
!= currentSegmentEncoding && !CanWriteValue)
98
ThrowHelper.ThrowInvalidOperationException_CannotMixEncodings(
_enclosingContainer
, currentSegmentEncoding);
103
if (
_enclosingContainer
== EnclosingContainerType.Object)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (6)
36
if (
_enclosingContainer
!= EnclosingContainerType.Utf16StringSequence)
67
Debug.Assert(
_enclosingContainer
== EnclosingContainerType.Utf16StringSequence);
204
if (
_enclosingContainer
!= EnclosingContainerType.Utf8StringSequence)
235
Debug.Assert(
_enclosingContainer
== EnclosingContainerType.Utf8StringSequence);
371
if (
_enclosingContainer
!= EnclosingContainerType.Base64StringSequence)
402
Debug.Assert(
_enclosingContainer
== EnclosingContainerType.Base64StringSequence);