Beispiel #1
0
 void ICollection <KeyValuePair <string, object> > .Add(KeyValuePair <string, object> item)
 {
     if (string.IsNullOrEmpty(item.Key))
     {
         throw RuntimeFailure.CannotSpecifyNullKey("item");
     }
     SetProperty(item.Key, item.Value);
 }
Beispiel #2
0
        bool ICollection <KeyValuePair <string, object> > .Remove(KeyValuePair <string, object> item)
        {
            if (string.IsNullOrEmpty(item.Key))
            {
                throw RuntimeFailure.CannotSpecifyNullKey("item");
            }

            object result;

            if (InnerMap.TryGetValue(item.Key, out result) && Equals(result, item.Value))
            {
                ClearProperty(item.Key);
                return(true);
            }
            return(false);
        }