コード例 #1
0
        /// <summary>
        /// Captures the current state of this <see cref="BoundableStretchControlGraphic"/>.
        /// </summary>
        public override object CreateMemento()
        {
            PointsMemento pointsMemento = new PointsMemento();

            this.Subject.CoordinateSystem = CoordinateSystem.Source;
            try
            {
                pointsMemento.Add(this.Subject.TopLeft);
                pointsMemento.Add(this.Subject.BottomRight);
            }
            finally
            {
                this.Subject.ResetCoordinateSystem();
            }

            return(pointsMemento);
        }
コード例 #2
0
        /// <summary>
        /// Captures the current state of this <see cref="VerticesControlGraphic"/>.
        /// </summary>
        public override object CreateMemento()
        {
            PointsMemento pointsMemento = new PointsMemento();

            this.Subject.CoordinateSystem = CoordinateSystem.Source;
            try
            {
                foreach (PointF point in this.Subject.Points)
                {
                    pointsMemento.Add(point);
                }
            }
            finally
            {
                this.Subject.ResetCoordinateSystem();
            }

            return(pointsMemento);
        }