// bool Remove(T item) internal bool Remove <K, V>(KeyValuePair <K, V> item) { object _this = JitHelpers.UnsafeCast <object>(this); IDictionary <K, V> _this_dictionary = _this as IDictionary <K, V>; if (_this_dictionary != null) { return(_this_dictionary.Remove(item.Key)); } else { IVector <KeyValuePair <K, V> > _this_vector = JitHelpers.UnsafeCast <IVector <KeyValuePair <K, V> > >(this); uint index; bool exists = _this_vector.IndexOf(item, out index); if (!exists) { return(false); } if (((uint)Int32.MaxValue) < index) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } VectorToListAdapter.RemoveAtHelper <KeyValuePair <K, V> >(_this_vector, index); return(true); } }
// bool Remove(T item) internal bool Remove <K, V>(KeyValuePair <K, V> item) { object _this = Unsafe.As <object>(this); if (_this is IDictionary <K, V> _this_dictionary) { return(_this_dictionary.Remove(item.Key)); } else { IVector <KeyValuePair <K, V> > _this_vector = Unsafe.As <IVector <KeyValuePair <K, V> > >(this); uint index; bool exists = _this_vector.IndexOf(item, out index); if (!exists) { return(false); } if (((uint)int.MaxValue) < index) { throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); } VectorToListAdapter.RemoveAtHelper <KeyValuePair <K, V> >(_this_vector, index); return(true); } }
internal void RemoveAt <T>(int index) { if (index < 0) { throw new ArgumentOutOfRangeException("index"); } VectorToListAdapter.RemoveAtHelper <T>(JitHelpers.UnsafeCast <IVector <T> >((object)this), (uint)index); }
internal bool Remove <T>(T item) { IVector <T> _this = JitHelpers.UnsafeCast <IVector <T> >((object)this); uint index; if (!_this.IndexOf(item, out index)) { return(false); } if ((uint)int.MaxValue < index) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } VectorToListAdapter.RemoveAtHelper <T>(_this, index); return(true); }
internal bool Remove <T>(T item) { IVector <T> vector = JitHelpers.UnsafeCast <IVector <T> >(this); uint num; if (!vector.IndexOf(item, out num)) { return(false); } if (2147483647U < num) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } VectorToListAdapter.RemoveAtHelper <T>(vector, num); return(true); }
// bool Remove(T item) internal bool Remove <T>(T item) { IVector <T> _this = Unsafe.As <IVector <T> >(this); bool exists = _this.IndexOf(item, out uint index); if (!exists) { return(false); } if (((uint)int.MaxValue) < index) { throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); } VectorToListAdapter.RemoveAtHelper <T>(_this, index); return(true); }
internal bool Remove <K, V>(KeyValuePair <K, V> item) { IDictionary <K, V> dictionary = JitHelpers.UnsafeCast <object>((object)this) as IDictionary <K, V>; if (dictionary != null) { return(dictionary.Remove(item.Key)); } IVector <KeyValuePair <K, V> > _this = JitHelpers.UnsafeCast <IVector <KeyValuePair <K, V> > >((object)this); uint index; if (!_this.IndexOf(item, out index)) { return(false); } if ((uint)int.MaxValue < index) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } VectorToListAdapter.RemoveAtHelper <KeyValuePair <K, V> >(_this, index); return(true); }
internal bool Remove <K, V>(KeyValuePair <K, V> item) { object obj = JitHelpers.UnsafeCast <object>(this); IDictionary <K, V> dictionary = obj as IDictionary <K, V>; if (dictionary != null) { return(dictionary.Remove(item.Key)); } IVector <KeyValuePair <K, V> > vector = JitHelpers.UnsafeCast <IVector <KeyValuePair <K, V> > >(this); uint num; if (!vector.IndexOf(item, out num)) { return(false); } if (2147483647U < num) { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } VectorToListAdapter.RemoveAtHelper <KeyValuePair <K, V> >(vector, num); return(true); }