void IDictionary.Remove(object key) { if (SortedDictionary <TKey, TValue> .IsCompatibleKey(key)) { this.Remove((TKey)key); } }
object IDictionary.this[object key] { get { TValue local; if (SortedDictionary <TKey, TValue> .IsCompatibleKey(key) && this.TryGetValue((TKey)key, out local)) { return(local); } return(null); } set { if (key == null) { System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key); } System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow <TValue>(value, System.ExceptionArgument.value); try { TKey local = (TKey)key; try { this[local] = (TValue)value; } catch (InvalidCastException) { System.ThrowHelper.ThrowWrongValueTypeArgumentException(value, typeof(TValue)); } } catch (InvalidCastException) { System.ThrowHelper.ThrowWrongKeyTypeArgumentException(key, typeof(TKey)); } } }
bool IDictionary.Contains(object key) { return(SortedDictionary <TKey, TValue> .IsCompatibleKey(key) && this.ContainsKey((TKey)key)); }