Exemplo n.º 1
0
 public void ClearDrawingPanel()
 {
     DrawnShapes.Clear();
     SelectedShapes.Clear();
     CreateMemento();
     _g.RefreshView();
 }
Exemplo n.º 2
0
        public void SetState(List <IShape> drawnShapes, ToolBar toolbar)
        {
            DrawnShapes.Clear();
            foreach (var shape in drawnShapes)
            {
                DrawnShapes.Add((IShape)shape.Clone());
            }

            ToolBar = (ToolBar)toolbar.Clone();
        }
Exemplo n.º 3
0
 public void RestoreState(Memento newState)
 {
     DrawnShapes.Clear();
     SelectedShapes.Clear();
     foreach (var shape in newState.DrawnShapes)
     {
         DrawnShapes.Add((IShape)shape.Clone());
     }
     ToolBar = (ToolBar)newState.ToolBar.Clone();
     _g.RefreshView();
     _g.RefreshToolBar();
 }
Exemplo n.º 4
0
        private void Clear_Clicked(object sender, RoutedEventArgs e)
        {
            DrawnShapes.Clear();

            HideEditPanel();

            DrawnShapesCombo.ItemsSource = null;
            DrawnShapesCombo.ItemsSource = DrawnShapes;

            if (ShapeToEdit != null)
            {
                ShapeToEdit.Mode = ShapeModes.Drawn;
                ShapeToEdit      = null;
            }
            canvasControl.Invalidate();
        }