Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     ToolRepository rep = new ToolRepository();
       ProcessStartInfo psi = new ProcessStartInfo();
       psi.Arguments = "\"" + rep.ToolsXmlFile + "\"";
       psi.FileName = editor;
       psi.WindowStyle = ProcessWindowStyle.Maximized;
       psi.WorkingDirectory = Path.GetDirectoryName(rep.ToolsXmlFile);
       Process.Start(psi);
 }
Exemplo n.º 2
0
 private void ReloadTools()
 {
     ToolRepository rep = new ToolRepository();
       List<ToolStripMenuItem> toDelete = new List<ToolStripMenuItem>();
       foreach (var tool in toolsToolStripMenuItem.DropDownItems) {
     ToolStripMenuItem item = tool as ToolStripMenuItem;
     if (item != null) {
       if (item.Tag.ToString() != "Keep") {
     item.Click -= it_Click;
     toDelete.Add(item);
       }
     }
       }
       foreach (var item in toDelete) {
     toolsToolStripMenuItem.DropDownItems.Remove(item);
       }
       foreach (var tool in rep.ListTools()) {
     ToolStripMenuItem it = new ToolStripMenuItem { Tag = tool, Text = tool.Title.Replace("&", "&&") };
     it.Click += it_Click;
     toolsToolStripMenuItem.DropDownItems.Add(it);
       }
 }