private void CreateMenuControl() { // build datastructure var menu = new MenuCreator(); var menuItems = menu.CreateMenuDataStructure(_layers, newToolStripMenuItem_Click, openToolStripMenuItem_Click, saveToolStripMenuItem_Click, exitToolStripMenuItem_Click, layerToolStripMenuItem_Click); // create a menustrip control from that data structure _menuStrip = menu.CreateMenu(menuItems); Controls.Add(_menuStrip); }
static void Main(string[] args) { while (string.IsNullOrEmpty(temp) || Directory.Exists(temp)) { temp = Path.GetFullPath(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())); } Directory.CreateDirectory(temp); if (args.Length == 1) { switch (args[0]) { case "--uninstall": Uninstaller.Start(); break; } Directory.Delete(temp, true); Environment.Exit(0); return; } ShowIntro(); var loop = true; while (loop) { var index = MenuCreator.CreateMenu(new[] { "$OVM_MODE Open Voice Modder", "Open drivers setup", "Exit" }); switch (index) { case 0: OpenVoiceModder(); break; case 1: Drivers(); break; default: loop = false; break; } } Directory.Delete(temp, true); }