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)); }
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)); }
public bool CanRemove (Constraint constraint) { return constraint.CanRemoveFromCollection (this, false); }
public bool CanRemove(Constraint constraint) { return(constraint.CanRemoveFromCollection(this, false)); }