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

◆ SetValue()

T System.Text.Json.JsonPropertyDictionary< T >.SetValue ( string propertyName,
T value,
Action assignParent = null )
inline

Definition at line 300 of file JsonPropertyDictionary.cs.

301 {
302 if (IsReadOnly)
303 {
304 ThrowHelper.ThrowNotSupportedException_NodeCollectionIsReadOnly();
305 }
306 if (propertyName == null)
307 {
308 throw new ArgumentNullException("propertyName");
309 }
311 T val = null;
312 if (_propertyDictionary != null)
313 {
315 {
316 assignParent?.Invoke();
318 return null;
319 }
321 if (val == value)
322 {
323 return null;
324 }
325 }
326 int num = FindValueIndex(propertyName);
327 if (num >= 0)
328 {
329 if (_propertyDictionary != null)
330 {
332 }
333 else
334 {
336 if (keyValuePair.Value == value)
337 {
338 return null;
339 }
340 val = keyValuePair.Value;
341 }
342 assignParent?.Invoke();
344 }
345 else
346 {
347 assignParent?.Invoke();
350 }
351 return val;
352 }
bool TryAdd(TKey key, TValue value)
void Add(TKey key, TValue value)
readonly List< KeyValuePair< string, T > > _propertyList

References System.Text.Json.JsonPropertyDictionary< T >._propertyDictionary, System.Text.Json.JsonPropertyDictionary< T >._propertyList, System.Collections.Generic.List< T >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Text.Json.JsonPropertyDictionary< T >.CreateDictionaryIfThresholdMet(), System.Text.Json.Dictionary, System.Text.Json.JsonPropertyDictionary< T >.FindValueIndex(), System.Text.Json.JsonPropertyDictionary< T >.IsReadOnly, System.Text.Json.ThrowHelper.ThrowNotSupportedException_NodeCollectionIsReadOnly(), System.Collections.Generic.Dictionary< TKey, TValue >.TryAdd(), and System.value.