Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OnTryWrite()

override bool System.Text.Json.Serialization.JsonDictionaryConverter< TDictionary, TKey, TValue >.OnTryWrite ( Utf8JsonWriter writer,
TDictionary dictionary,
JsonSerializerOptions options,
ref WriteStack state )
inlinesealedpackageinherited

Definition at line 197 of file JsonDictionaryConverter.cs.

198 {
199 if (dictionary == null)
200 {
201 writer.WriteNullValue();
202 return true;
203 }
204 if (!state.Current.ProcessedStartToken)
205 {
207 writer.WriteStartObject();
208 if (options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve && JsonSerializer.WriteReferenceForObject(this, dictionary, ref state, writer) == MetadataPropertyName.Ref)
209 {
210 return true;
211 }
212 state.Current.DeclaredJsonPropertyInfo = state.Current.JsonTypeInfo.ElementTypeInfo.PropertyInfoForTypeInfo;
213 }
215 if (flag && !state.Current.ProcessedEndToken)
216 {
218 writer.WriteEndObject();
219 }
220 return flag;
221 }
bool OnWriteResume(Utf8JsonWriter writer, TDictionary dictionary, JsonSerializerOptions options, ref WriteStack state)

References System.dictionary, System.Text.Json.Dictionary, System.Text.Json.Serialization.JsonDictionaryConverter< TDictionary, TKey, TValue >.OnWriteResume(), System.options, System.state, System.writer, and System.Text.Json.JsonSerializer.WriteReferenceForObject().