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)
125Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf8StringSequence); 154Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf16StringSequence); 182Debug.Assert(_enclosingContainer == EnclosingContainerType.Base64StringSequence); 653if (_enclosingContainer == EnclosingContainerType.Object) 1079if (_enclosingContainer != EnclosingContainerType.Array) 1088if (_enclosingContainer != EnclosingContainerType.Object) 1264private bool IsWritingPartialString => _enclosingContainer >= EnclosingContainerType.Utf8StringSequence;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (3)
40if (_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName) 53if (_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName) 71Debug.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. 36private bool CanWriteValue => _enclosingContainer == EnclosingContainerType.Array | (byte)_enclosingContainer == (byte)_tokenType; 63if (_enclosingContainer == EnclosingContainerType.Object) 86if (_enclosingContainer != currentSegmentEncoding && !CanWriteValue) 98ThrowHelper.ThrowInvalidOperationException_CannotMixEncodings(_enclosingContainer, currentSegmentEncoding); 103if (_enclosingContainer == EnclosingContainerType.Object)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (6)
36if (_enclosingContainer != EnclosingContainerType.Utf16StringSequence) 67Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf16StringSequence); 204if (_enclosingContainer != EnclosingContainerType.Utf8StringSequence) 235Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf8StringSequence); 371if (_enclosingContainer != EnclosingContainerType.Base64StringSequence) 402Debug.Assert(_enclosingContainer == EnclosingContainerType.Base64StringSequence);