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

◆ Add() [2/4]

void IDictionary. System.Collections.Generic.SortedDictionary< TKey, TValue >.Add ( object key,
object value )
inlineprivate

Definition at line 764 of file SortedDictionary.cs.

765 {
766 if (key == null)
767 {
768 throw new ArgumentNullException("key");
769 }
770 if (value == null && default(TValue) != null)
771 {
772 throw new ArgumentNullException("value");
773 }
774 try
775 {
776 TKey key2 = (TKey)key;
777 try
778 {
779 Add(key2, (TValue)value);
780 }
781 catch (InvalidCastException)
782 {
783 throw new ArgumentException(System.SR.Format(System.SR.Arg_WrongType, value, typeof(TValue)), "value");
784 }
785 }
786 catch (InvalidCastException)
787 {
788 throw new ArgumentException(System.SR.Format(System.SR.Arg_WrongType, key, typeof(TKey)), "key");
789 }
790 }
static string Arg_WrongType
Definition SR.cs:16
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7

References System.Add, System.SR.Arg_WrongType, System.SR.Format(), System.key, and System.value.