Пример #1
0
        private void menuDeleteAll_Click(object sender, RoutedEventArgs e)
        {
            int x = DrawArea.TheLayers.ActiveLayerIndex;
            CommandDeleteAll command = new CommandDeleteAll(DrawArea.TheLayers);

            if (DrawArea.TheLayers[x].Graphics.Clear())
            {
                DrawArea.AddCommandToHistory(command);
                if (DrawArea.CanUndo == true)
                {
                    btnUndo.IsEnabled = true;
                }
                else if (DrawArea.CanUndo == false)
                {
                    btnUndo.IsEnabled = false;
                }
                if (DrawArea.CanRedo == true)
                {
                    btnRedo.IsEnabled = true;
                }
                else if (DrawArea.CanRedo == false)
                {
                    btnRedo.IsEnabled = false;
                }
                DrawArea.Refresh();
            }
        }
Пример #2
0
        // New file .meg
        public void NewMeg()
        {
            int x = TheLayers.ActiveLayerIndex;
            CommandDeleteAll command = new CommandDeleteAll(TheLayers);

            if (TheLayers[x].Graphics.Clear())
            {
                Refresh();
            }
            ClearHistory();
            DocManager.NewDocument();
        }