void tentry_Click(object sender, EventArgs e) { ModelDesignerWindow mdlWin = new ModelDesignerWindow(); mdlWin.OpenFileByPath(System.IO.Path.Combine("./core/samples/", ((ToolStripItem)sender).Text), true); AppGlobals.ShowWin(mdlWin, WeifenLuo.WinFormsUI.Docking.DockState.Document); }
private void mainForm_Load(object sender, EventArgs e) { if (System.IO.Directory.Exists("./core/samples")) { string[] files = System.IO.Directory.GetFiles("./core/samples", "*.emdl", System.IO.SearchOption.AllDirectories); foreach (var file in files) { System.IO.FileInfo fi = new System.IO.FileInfo(file); var tentry = samplesToolStripMenuItem.DropDownItems.Add(fi.Name); tentry.Click += tentry_Click; } } if (AppGlobals.args.Count() > 0) { for (int i = 0; i < AppGlobals.args.Count(); i++) { string arg = AppGlobals.args[i]; if (System.IO.File.Exists(arg)) { ModelDesignerWindow designerWin = new ModelDesignerWindow(); designerWin.Show(masterDockPanel, WeifenLuo.WinFormsUI.Docking.DockState.Document); designerWin.OpenFileByPath(arg); } } } AppGlobals.ShowGenericResults(); }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (this.ActiveMdiChild.GetType() == typeof(ModelDesignerWindow)) { ModelDesignerWindow designerWin = (ModelDesignerWindow)this.ActiveMdiChild; designerWin.Save(); } }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { ModelDesignerWindow designerWin; if (this.ActiveMdiChild != null && this.ActiveMdiChild.GetType() == typeof(ModelDesignerWindow)) { designerWin = (ModelDesignerWindow)this.ActiveMdiChild; if (designerWin.modelDocEditor.Document.ElementCount() == 0) { designerWin.Open(); return; } } designerWin = new ModelDesignerWindow(); designerWin.Show(masterDockPanel, WeifenLuo.WinFormsUI.Docking.DockState.Document); designerWin.Open(); designerWin.Invalidate(); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { ModelDesignerWindow win = new ModelDesignerWindow(); win.Show(masterDockPanel, WeifenLuo.WinFormsUI.Docking.DockState.Document); }