Exemplo n.º 1
0
        public void Remove(Constraint constraint)
        {
            //LAMESPEC: spec doesn't document the ArgumentException the
            //will be thrown if the CanRemove rule is violated

            //LAMESPEC: spec says an exception will be thrown
            //if the element is not in the collection. The implementation
            //doesn't throw an exception. ArrayList.Remove doesn't throw if the
            //element doesn't exist
            //ALSO the overloaded remove in the spec doesn't say it throws any exceptions

            //not null
            if (null == constraint)
            {
                throw new ArgumentNullException();
            }

            if (!constraint.CanRemoveFromCollection(this, true))
            {
                return;
            }

            constraint.RemoveFromConstraintCollectionCleanup(this);
            constraint.ConstraintCollection = null;
            List.Remove(constraint);
            OnCollectionChanged(new CollectionChangeEventArgsDerived(CollectionChangeActionDerived.Remove, this));
        }
Exemplo n.º 2
0
		public void Remove (Constraint constraint)
		{
			//LAMESPEC: spec doesn't document the ArgumentException the
			//will be thrown if the CanRemove rule is violated

			//LAMESPEC: spec says an exception will be thrown
			//if the element is not in the collection. The implementation
			//doesn't throw an exception. ArrayList.Remove doesn't throw if the
			//element doesn't exist
			//ALSO the overloaded remove in the spec doesn't say it throws any exceptions

			//not null
			if (null == constraint)
				throw new ArgumentNullException();

			if (!constraint.CanRemoveFromCollection (this, true))
				return;

			constraint.RemoveFromConstraintCollectionCleanup (this);
			constraint.ConstraintCollection = null;
			List.Remove (constraint);
			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, this));
		}
Exemplo n.º 3
0
		public bool CanRemove (Constraint constraint)
		{
			return constraint.CanRemoveFromCollection (this, false);
		}
Exemplo n.º 4
0
 public bool CanRemove(Constraint constraint)
 {
     return(constraint.CanRemoveFromCollection(this, false));
 }