System.Collections.Specialized.OrderedDictionary.Add C# (CSharp) Method

Add() public method

public Add ( object key, object value ) : void
key object
value object
return void
        public void Add(object key, object value)
        {
            if (_readOnly)
            {
                throw new NotSupportedException(SR.OrderedDictionary_ReadOnly);
            }
            objectsTable.Add(key, value);
            objectsArray.Add(new DictionaryEntry(key, value));
        }

Usage Example

示例#1
0
 public void PassingEqualityComparers()
 {
     var eqComp = new CaseInsensitiveEqualityComparer();
     var d1 = new OrderedDictionary(eqComp);
     d1.Add("foo", "bar");
     Assert.Throws<ArgumentException>(() => d1.Add("FOO", "bar"));
 }
All Usage Examples Of System.Collections.Specialized.OrderedDictionary::Add