Exemple #1
0
        private void childForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (sender is DisplayChildForm)
            {
                DisplayChildForm childForm = (DisplayChildForm)sender;
                Diagram          diagram   = childForm.Display.Diagram;
                Debug.Assert(diagram != null);

                // Clean up
                UnregisterChildFormEvents(childForm);
                childForm.Display.Diagram = null;
                childForm.Display.DiagramSetController = null;
                displayChildForms.Remove(diagram.Name);

                // Endable menu item
                foreach (ToolStripMenuItem item in diagramsToolStripMenuItem.DropDownItems)
                {
                    if (item.Tag == diagram)
                    {
                        item.Enabled = true;
                        break;
                    }
                }
            }
        }
Exemple #2
0
		private void ShowDisplayChildForm(Diagram diagram) {
			DisplayChildForm childForm = new DisplayChildForm();
			RegisterChildFormEvents(childForm);
			childForm.MdiParent = this;
			childForm.Display.DiagramSetController = diagramSetController;
			childForm.Display.Diagram = diagram;
			childForm.Show();

			displayChildForms.Add(diagram.Name, childForm);
		}
Exemple #3
0
        private void ShowDisplayChildForm(Diagram diagram)
        {
            DisplayChildForm childForm = new DisplayChildForm();

            RegisterChildFormEvents(childForm);
            childForm.MdiParent = this;
            childForm.Display.DiagramSetController = diagramSetController;
            childForm.Display.Diagram = diagram;
            childForm.Show();

            displayChildForms.Add(diagram.Name, childForm);
        }
Exemple #4
0
		private void UnregisterChildFormEvents(DisplayChildForm childForm) {
			childForm.FormClosed -= childForm_FormClosed;
			childForm.Disposed -= childForm_Disposed;
		}
Exemple #5
0
 private void UnregisterChildFormEvents(DisplayChildForm childForm)
 {
     childForm.FormClosed -= childForm_FormClosed;
     childForm.Disposed   -= childForm_Disposed;
 }