예제 #1
0
        /// <summary>
        /// Removes the vertex that was added by the Execute method.
        /// </summary>
        /// <returns></returns>
        public override bool Undo()
        {
            bool success = false;

            if (this.Node != null)
            {
                IPoints objPoints = this.Node as IPoints;
                if (objPoints != null)
                {
                    if (this.vertexIdx >= 0 && this.vertexIdx < objPoints.PointCount)
                    {
                        objPoints.RemovePoint(this.vertexIdx);
                        success = true;
                    }
                }
            }

            return(success);
        }
예제 #2
0
        /// <summary>
        /// Deletes the specified vertex from the node.
        /// </summary>
        /// <param name="cmdTarget">Unused</param>
        /// <returns>true if successful, otherwise false</returns>
        /// <remarks>
        /// This method gets the IPoints interface from the node and
        /// calls <see cref="Syncfusion.Windows.Forms.Diagram.IPoints.RemovePoint"/>
        /// to remove the vertex.
        /// </remarks>
        public override bool Do(object cmdTarget)
        {
            bool success = false;

            if (this.Node != null)
            {
                IPoints objPoints = this.Node as IPoints;
                if (objPoints != null)
                {
                    if (this.vertexIdx >= 0 && this.vertexIdx < objPoints.PointCount)
                    {
                        this.ptValue = objPoints.GetPoint(this.vertexIdx);
                        objPoints.RemovePoint(this.vertexIdx);
                        success = true;
                    }
                }
            }

            return(success);
        }