Esempio n. 1
0
        private void RedoAction()
        {
            if (_redoList.Count == 0)
            {
                return;
            }
            IAction action = _redoList.Pop();

            ActionExecutor.Execute(action, Source, false);
            _undoList.Push(action);
        }
Esempio n. 2
0
 private void NewAction(IAction action)
 {
     if (ReadOnly)
     {
         return;
     }
     if (action != null)
     {
         _redoList.Clear();
         ActionExecutor.Execute(action, Source, false);
         _undoList.Push(action);
         if (action.Action == ActionType.NewShape ||
             action.Action == ActionType.ModifyShape ||
             action.Action == ActionType.DeleteShape)
         {
             action = Builder.Build(ActionBuildType.Deselect, null);
             ActionExecutor.Execute(action, Source, false);
             _undoList.Push(action);
         }
     }
 }
Esempio n. 3
0
        public void NewGhost(ShapeType type)
        {
            IAction action;

            if (ReadOnly)
            {
                return;
            }
            ProcessOldGhost();
            if (type == ShapeType.None)
            {
                if (Source.Ghost.State == GhostState.NotAvailable)
                {
                    return;
                }
                action = Builder.Build(ActionBuildType.Deselect, null);
            }
            else
            {
                ShapeData data = new ShapeData(type);
                data.DrawColor   = SurfaceDrawColor;
                data.FillColor   = SurfaceFillColor;
                data.IsFillColor = SurfaceIsFillColor;
                data.Hatch       = SurfaceHatch;
                data.IsHatch     = SurfaceIsHatch;
                data.IsTexture   = SurfaceIsTexture;
                data.TextureName = SurfaceTexture;
                data.LineWidth   = SurfaceLineWidth;
                IShape shape = Source.Factory.Create(data);
                action = Builder.Build(
                    ActionBuildType.CreateNewShape, shape);
            }
            _redoList.Clear();
            ActionExecutor.Execute(action, Source, false);
            _undoList.Push(action);
        }