ValidateNullValue() private static method

private static ValidateNullValue ( object? value, string argument ) : void
value object?
argument string
return void
Esempio n. 1
0
        void IList.Insert(int index, object value)
        {
            ReadOnlyCollectionBuilder <T> .ValidateNullValue(value, "value");

            try
            {
                this.Insert(index, (T)value);
            }
            catch (InvalidCastException)
            {
                ReadOnlyCollectionBuilder <T> .ThrowInvalidTypeException(value, "value");
            }
        }
Esempio n. 2
0
        int IList.Add(object value)
        {
            ReadOnlyCollectionBuilder <T> .ValidateNullValue(value, "value");

            try
            {
                this.Add((T)value);
            }
            catch (InvalidCastException)
            {
                ReadOnlyCollectionBuilder <T> .ThrowInvalidTypeException(value, "value");
            }
            return(this.Count - 1);
        }
Esempio n. 3
0
        object IList.this[int index]
        {
            get
            {
                return(this[index]);
            }
            set
            {
                ReadOnlyCollectionBuilder <T> .ValidateNullValue(value, "value");

                try
                {
                    this[index] = (T)value;
                }
                catch (InvalidCastException)
                {
                    ReadOnlyCollectionBuilder <T> .ThrowInvalidTypeException(value, "value");
                }
            }
        }