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

◆ TryAdd< TKey, TValue >()

static bool System.Collections.Generic.CollectionExtensions.TryAdd< TKey, TValue > ( this IDictionary< TKey, TValue > dictionary,
TKey key,
TValue value )
inlinestatic

Definition at line 25 of file CollectionExtensions.cs.

26 {
27 if (dictionary == null)
28 {
29 throw new ArgumentNullException("dictionary");
30 }
31 if (!dictionary.ContainsKey(key))
32 {
33 dictionary.Add(key, value);
34 return true;
35 }
36 return false;
37 }

References System.dictionary, System.key, and System.value.