private void FrmMain_Load(object sender, EventArgs e) { if (File.Exists(LAYOUTSTOREFILE)) { dockPanel1.LoadFromXml(LAYOUTSTOREFILE, m_deserializeDockContent); for (int i = documents.Count; i > 0; i--) { frmDocument doc = documents[i - 1]; if (!doc.FileExists) { documents.Remove(doc); doc.Close(); } } } else { ResetLayout(); } imagePreview.VisibleChanged += DockWindow_VisibleChanged; hintWindow.VisibleChanged += DockWindow_VisibleChanged; outputWindow.VisibleChanged += DockWindow_VisibleChanged; svgContents.VisibleChanged += DockWindow_VisibleChanged; AddNewScriptIfNone(); RefreshViewMenuItemsCheckedState(); }
private void CloseScriptToolStripMenuItem_Click(object sender, EventArgs e) { frmDocument docToClose = GetActiveDocument(); if (ContinueIfChanges(docToClose)) { documents.Remove(docToClose); docToClose.Close(); } AddNewScriptIfNone(); }