コード例 #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));
        }
コード例 #2
0
ファイル: ConstraintCollection.cs プロジェクト: nlhepler/mono
		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));
		}
コード例 #3
0
ファイル: ConstraintCollection.cs プロジェクト: nlhepler/mono
		public bool CanRemove (Constraint constraint)
		{
			return constraint.CanRemoveFromCollection (this, false);
		}
コード例 #4
0
 public bool CanRemove(Constraint constraint)
 {
     return(constraint.CanRemoveFromCollection(this, false));
 }