protected override void RemoveCore(Binding dataBinding)
 {
     if (dataBinding.BindableComponent != this.control)
     {
         throw new ArgumentException(System.Windows.Forms.SR.GetString("BindingsCollectionForeign"));
     }
     dataBinding.SetBindableComponent(null);
     base.RemoveCore(dataBinding);
 }
Пример #2
0
 /// <include file='doc\ControlBindingsCollection.uex' path='docs/doc[@for="ControlBindingsCollection.RemoveCore"]/*' />
 protected override void RemoveCore(Binding dataBinding)
 {
     if (dataBinding.BindableComponent != control)
     {
         throw new ArgumentException(SR.BindingsCollectionForeign);
     }
     dataBinding.SetBindableComponent(null);
     base.RemoveCore(dataBinding);
 }
Пример #3
0
        // internalonly
        /// <include file='doc\ControlBindingsCollection.uex' path='docs/doc[@for="ControlBindingsCollection.ClearCore"]/*' />
        protected override void ClearCore()
        {
            int numLinks = Count;

            for (int i = 0; i < numLinks; i++)
            {
                Binding dataBinding = this[i];
                dataBinding.SetBindableComponent(null);
            }
            base.ClearCore();
        }
Пример #4
0
        protected override void RemoveCore(Binding dataBinding)
        {
            ArgumentNullException.ThrowIfNull(dataBinding);

            if (dataBinding.BindableComponent != _control)
            {
                throw new ArgumentException(SR.BindingsCollectionForeign, nameof(dataBinding));
            }

            dataBinding.SetBindableComponent(null);
            base.RemoveCore(dataBinding);
        }
 protected override void AddCore(Binding dataBinding)
 {
     if (dataBinding == null)
     {
         throw new ArgumentNullException("dataBinding");
     }
     if (dataBinding.BindableComponent == this.control)
     {
         throw new ArgumentException(System.Windows.Forms.SR.GetString("BindingsCollectionAdd1"));
     }
     if (dataBinding.BindableComponent != null)
     {
         throw new ArgumentException(System.Windows.Forms.SR.GetString("BindingsCollectionAdd2"));
     }
     dataBinding.SetBindableComponent(this.control);
     base.AddCore(dataBinding);
 }
 protected override void AddCore(Binding dataBinding)
 {
     if (dataBinding == null)
     {
         throw new ArgumentNullException("dataBinding");
     }
     if (dataBinding.BindableComponent == this.control)
     {
         throw new ArgumentException(System.Windows.Forms.SR.GetString("BindingsCollectionAdd1"));
     }
     if (dataBinding.BindableComponent != null)
     {
         throw new ArgumentException(System.Windows.Forms.SR.GetString("BindingsCollectionAdd2"));
     }
     dataBinding.SetBindableComponent(this.control);
     base.AddCore(dataBinding);
 }
Пример #7
0
        protected override void AddCore(Binding dataBinding)
        {
            ArgumentNullException.ThrowIfNull(dataBinding);

            if (dataBinding.BindableComponent == _control)
            {
                throw new ArgumentException(SR.BindingsCollectionAdd1, nameof(dataBinding));
            }

            if (dataBinding.BindableComponent is not null)
            {
                throw new ArgumentException(SR.BindingsCollectionAdd2, nameof(dataBinding));
            }

            // important to set prop first for error checking.
            dataBinding.SetBindableComponent(_control);

            base.AddCore(dataBinding);
        }
Пример #8
0
        /// <include file='doc\ControlBindingsCollection.uex' path='docs/doc[@for="ControlBindingsCollection.AddCore"]/*' />
        /// <devdoc>
        /// Creates the binding and adds it to the collection.  An InvalidBindingException is thrown
        /// if this binding can't be constructed.  An exception is thrown if a binding to the same target and Property as an existing binding or
        /// if the binding's column isn't a valid column given this DataSource.Table's schema.
        /// Fires the CollectionChangedEvent.
        /// </devdoc>
        protected override void AddCore(Binding dataBinding)
        {
            if (dataBinding == null)
            {
                throw new ArgumentNullException(nameof(dataBinding));
            }
            if (dataBinding.BindableComponent == control)
            {
                throw new ArgumentException(SR.BindingsCollectionAdd1);
            }
            if (dataBinding.BindableComponent != null)
            {
                throw new ArgumentException(SR.BindingsCollectionAdd2);
            }

            // important to set prop first for error checking.
            dataBinding.SetBindableComponent(control);

            base.AddCore(dataBinding);
        }
 /// <include file='doc\ControlBindingsCollection.uex' path='docs/doc[@for="ControlBindingsCollection.RemoveCore"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 protected override void RemoveCore(Binding dataBinding) {
     if (dataBinding.BindableComponent != control)
         throw new ArgumentException(SR.GetString(SR.BindingsCollectionForeign));
     dataBinding.SetBindableComponent(null);
     base.RemoveCore(dataBinding);
 }
        /// <include file='doc\ControlBindingsCollection.uex' path='docs/doc[@for="ControlBindingsCollection.AddCore"]/*' />
        /// <devdoc>
        /// Creates the binding and adds it to the collection.  An InvalidBindingException is thrown
        /// if this binding can't be constructed.  An exception is thrown if a binding to the same target and Property as an existing binding or
        /// if the binding's column isn't a valid column given this DataSource.Table's schema.
        /// Fires the CollectionChangedEvent.
        /// </devdoc>
        protected override void AddCore(Binding dataBinding) {
            if (dataBinding == null)
                throw new ArgumentNullException("dataBinding");
            if (dataBinding.BindableComponent == control)
                throw new ArgumentException(SR.GetString(SR.BindingsCollectionAdd1));
            if (dataBinding.BindableComponent != null)
                throw new ArgumentException(SR.GetString(SR.BindingsCollectionAdd2));

            // important to set prop first for error checking.
            dataBinding.SetBindableComponent(control);

            base.AddCore(dataBinding);
        }
 protected override void RemoveCore(Binding dataBinding)
 {
     if (dataBinding.BindableComponent != this.control)
     {
         throw new ArgumentException(System.Windows.Forms.SR.GetString("BindingsCollectionForeign"));
     }
     dataBinding.SetBindableComponent(null);
     base.RemoveCore(dataBinding);
 }