コード例 #1
0
        public override bool Move(Point offset)
        {
            var previousPositions = (new Point(Begin.Position.X, Begin.Position.Y), new Point(End.Position.X, End.Position.Y));

            Begin.MoveIgnoringRelations(offset);
            End.MoveIgnoringRelations(offset);

            if (UnderlyingPolygon != null)
            {
                if (!UnderlyingPolygon.CorrectRelations(Begin) || !UnderlyingPolygon.CorrectRelations(End))
                {
                    Begin.Position = previousPositions.Item1;
                    End.Position   = previousPositions.Item2;
                    return(false);
                }
            }

            return(true);
        }