Ejemplo n.º 1
0
        /// <include file='..\..\..\..\..\..\..\doc\snippets\Microsoft.Data.SqlClient\SqlParameterCollection.xml' path='docs/members[@name="SqlParameterCollection"]/RemoveValue2/*' />
        override public void Remove(object value)
        {
            OnChange();  // fire event before value is validated
            ValidateType(value);
            int index = IndexOf(value);

            if (-1 != index)
            {
                RemoveIndex(index);
            }
            else if (this != ((SqlParameter)value).CompareExchangeParent(null, this))
            {
                throw ADP.CollectionRemoveInvalidObject(ItemType, this);
            }
        }
Ejemplo n.º 2
0
        override public void Remove(object value)
        {
            OnChange();
            SqlParameter castedValue = ValidateType(value);
            int          index       = InnerList.IndexOf(castedValue);

            if (-1 != index)
            {
                RemoveIndex(index);
            }
            else if (this != ((SqlParameter)value).CompareExchangeParent(null, this))
            {
                throw ADP.CollectionRemoveInvalidObject(typeof(SqlParameter), this);
            }
        }
Ejemplo n.º 3
0
        public override void Remove(object value)
        {
            OnChange();
            ValidateType(value);
            int index = IndexOf(value);

            if (-1 != index)
            {
                RemoveIndex(index);
            }
            else if (this != ((OleDbParameter)value).CompareExchangeParent(null, this))
            {
                throw ADP.CollectionRemoveInvalidObject(s_itemType, this);
            }
        }
        /// <include file='doc\OleDbParameterCollection.uex' path='docs/doc[@for="OleDbParameterCollection.Remove"]/*' />
        public void Remove(object value)
        {
            OnSchemaChanging(); // fire event before value is validated
            ValidateType(value);
            int index = IndexOf((OleDbParameter)value);

            if (-1 != index)
            {
                RemoveIndex(index);
            }
            else
            {
                throw ADP.CollectionRemoveInvalidObject(ItemType, this);
            }
        }