Exemplo n.º 1
0
        public override void LeftButtonEndDrag(Pane pane, PointF location, PointF locationStart, float pixelSize, ref bool displayUpdateNeeded)
        {
            Debug.Assert(pane == Pane.Map);

            DragTo(location);

            PointF upperLeft  = new PointF(currentObj.rect.Left, currentObj.rect.Bottom);
            float  cellSize   = currentObj.CellSize;
            int    numColumns = currentObj.NumberOfColumns;

            // Create the new description, unless it's ridiculously small.
            if (cellSize > 0.5F)
            {
                CourseDesignator[] courses = null;
                courses = new CourseDesignator[] { courseDesignator.WithAllVariations() };

                undoMgr.BeginCommand(1522, CommandNameText.AddObject);
                Id <Special> specialId = ChangeEvent.AddDescription(eventDB, false, courses, upperLeft, cellSize, numColumns);
                undoMgr.EndCommand(1522);

                selectionMgr.SelectSpecial(specialId);
            }


            controller.DefaultCommandMode();
            displayUpdateNeeded = true;
        }