void IList.Remove(object value) { if (!CollectionWrapper <T> .IsCompatibleObject(value)) { return; } this.Remove((T)value); }
bool IList.Contains(object value) { if (CollectionWrapper <T> .IsCompatibleObject(value)) { return(this.Contains((T)value)); } return(false); }
private static void VerifyValueType(object value) { if (!CollectionWrapper <T> .IsCompatibleObject(value)) { throw new ArgumentException( "The value '{0}' is not of type '{1}' and cannot be used in this generic collection.".FormatWith( (IFormatProvider)CultureInfo.InvariantCulture, value, (object)typeof(T)), nameof(value)); } }
int IList.IndexOf(object value) { if (this._genericCollection != null) { throw new InvalidOperationException("Wrapped ICollection<T> does not support IndexOf."); } if (CollectionWrapper <T> .IsCompatibleObject(value)) { return(this._list.IndexOf((object)(T)value)); } return(-1); }