Example #1
0
        //Dictionary<string, Stack<IGraphCommand>> Diccommands = new Dictionary<string, Stack<IGraphCommand>>();

        public Bitmap Draw(IGraphCommand command, bool AddUndo = true)
        {
            if (DicUndocommands.ContainsKey(CurrentWindow))
            {
                UndoBitmaps = DicUndocommands[CurrentWindow];
                RedoBitmaps = DicRedocommands[CurrentWindow];
            }
            else
            {
                UndoBitmaps = new Stack <Bitmap>();
                RedoBitmaps = new Stack <Bitmap>();
                DicUndocommands.Add(CurrentWindow, UndoBitmaps);
                DicRedocommands.Add(CurrentWindow, RedoBitmaps);
            }
            if (command is PenDraw)
            {
                if (Config.parameter.iParameter[0] == 1)
                {
                    //Undocommands.Push(command);
                    UndoBitmaps.Push(command.bitmap);
                    RedoBitmaps.Clear();
                    //Redocommands.Clear();
                }
            }
            else if (AddUndo)
            {
                //Undocommands.Push(command);
                UndoBitmaps.Push(command.bitmap);
                RedoBitmaps.Clear();
                // Redocommands.Clear();
            }
            return(command.Draw());
        }
Example #2
0
 public void Draw(IGraphCommand command)
 {
     command.Draw();
     commands.Push(command);
 }