예제 #1
0
        //--------------------------------------------------------------------------------------------------

        #endregion

        #region Operands

        public bool AddOperand(IShapeOperand operandShape)
        {
            Operands.Add(operandShape);
            operandShape.AddDependent(this);

            RaisePropertyChanged("ChildCount");
            Invalidate();

            return(true);
        }
예제 #2
0
        //--------------------------------------------------------------------------------------------------

        public virtual bool ReplaceOperand(int operandIndex, IShapeOperand operandShape)
        {
            Debug.Assert(operandIndex < Operands.Count);
            Debug.Assert(operandShape != null);

            if (!CanReplaceOperand(operandIndex))
            {
                return(false);
            }

            var oldOp = Operands[operandIndex];

            oldOp?.RemoveDependent(this);

            Operands[operandIndex] = operandShape;
            operandShape.AddDependent(this);

            RaisePropertyChanged("ChildCount");
            Invalidate();
            return(true);
        }