public void NewDocument()
        {
            CloseDocument();

            document     = new DrawingDocument();
            graphicsView = new GraphicsView();
            mainForm.SetLeftPanel(graphicsView);
            graphicsView.SetDocumentAndRegisterToDocEvents(document);
            infoPanel.SetDocumentAndRegisterToDocEvents(document);

            #region Documents
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.CloseDocument, true);
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.SaveDocument, true);
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.SaveAsDocument, true);
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.ClearDocument, true);
            #endregion

            #region Tools
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.ClearDocument, true);
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.Undo, false);
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.NewRect, true);
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.NewEllipse, true);
            CommandBindingManager.Instance.EnableCommandBinding(CommandName.SelectShape, true);
            #endregion

            addTestData();
        }
 public void RemoveDocumentAndUnregisterDocEvents()
 {
     // Fontos a sorrend
     UnRegisterToDocEvents();
     this.document = null;
 }
 public void SetDocumentAndRegisterToDocEvents(Document document)
 {
     this.document = (DrawingDocument)document;
     RegisterToDocEvents();
 }
Esempio n. 4
0
 public void RemoveDocumentAndUnregisterDocEvents()
 {
     UnRegisterToDocEvents();
     this.document = null;
 }