private void worker_DoWork(object sender, DoWorkEventArgs e) { try { trDialog = new TracingDialog(); trDialog.ShowDialog(); } catch { MessageBox.Show("Tracing file seems to be invalid"); } }
void CreateMenus() { ToolStripMenuItem open = new ToolStripMenuItem(); open.ShortcutKeys = Keys.Control | Keys.O; //open.Text = "&Open..."; open.Text = StringParser.Parse("${res:XML.MainMenu.FileMenu.Open}"); open.Click += new System.EventHandler(OpenClick); ToolStripMenuItem close = new ToolStripMenuItem(); close.Text = StringParser.Parse("${res:Global.CloseButtonText}"); close.Enabled = false; close.Click += new EventHandler(CloseClick); ToolStripMenuItem exit = new ToolStripMenuItem(); exit.Text = StringParser.Parse("${res:XML.MainMenu.FileMenu.Exit}"); exit.Click += new System.EventHandler(ExitClick); ToolStripMenuItem fileMenuItem = new ToolStripMenuItem(); fileMenuItem.DropDownItems.AddRange(new ToolStripMenuItem[] { open, close, exit }); fileMenuItem.Text = StringParser.Parse("${res:XML.MainMenu.FileMenu}"); ToolStripMenuItem viewMenuItem = new ToolStripMenuItem(); ToolStripMenuItem mi = new ToolStripMenuItem(); mi.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.ObjectTreeMenuItem}"); mi.Click += new System.EventHandler(CustObjectClick); viewMenuItem.DropDownItems.Add(mi); mi = new ToolStripMenuItem(); mi.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.TypeHandlersMenuItem}"); mi.Click += new System.EventHandler(CustTypeHandlerClick); viewMenuItem.DropDownItems.Add(mi); mi = new ToolStripMenuItem(); mi.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.PanelsMenuItem}"); mi.Click += new System.EventHandler(CustPanelClick); viewMenuItem.DropDownItems.Add(mi); mi = new ToolStripMenuItem(); mi.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.DirectoriesMenuItem}"); mi.Click += new System.EventHandler(CustDirClick); viewMenuItem.DropDownItems.Add(mi); mi = new ToolStripMenuItem(); mi.Text = "&ActiveX/COM..."; mi.Click += new System.EventHandler(CustActiveXClick); viewMenuItem.DropDownItems.Add(mi); // Create the customization form _customizeForm = new CustomizeDialog(); viewMenuItem.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.OptionsMenuItem}"); ToolStripMenuItem actionMenu = new ToolStripMenuItem(); actionMenu.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.ActionMenuItem}"); ActionMenuHelper actionMenuHelper = new ActionMenuHelper(close); actionMenuHelper.BuildActionMenu(actionMenu); ActionMenuHelper.Helper = actionMenuHelper; ToolStripMenuItem editMenu = new ToolStripMenuItem(); editMenu.Text = StringParser.Parse("${res:XML.MainMenu.EditMenu}"); actionMenuHelper.BuildEditMenu(editMenu); editMenu.DropDownItems.Add("-"); // Create the find form mi = new ToolStripMenuItem(); mi.Text = StringParser.Parse("${res:ComponentInspector.InspectorMenu.Find}"); mi.ShortcutKeys = Keys.Control | Keys.F; mi.Click += new System.EventHandler(FindClick); editMenu.DropDownItems.Add(mi); // Create the attach form _attachForm = new AttachDialog(); ToolStripMenuItem remoteMenuItem = new ToolStripMenuItem(); remoteMenuItem.Text = "&Development"; mi = new ToolStripMenuItem(); mi.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.AttachMenuItem}"); mi.Click += new System.EventHandler(AttachClick); remoteMenuItem.DropDownItems.Add(mi); // Create the attach form _tracingForm = new TracingDialog(); mi = new ToolStripMenuItem(); mi.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.TracingMenuItem}"); mi.Click += new System.EventHandler(TracingClick); remoteMenuItem.DropDownItems.Add(mi); ToolStripMenuItem about = new ToolStripMenuItem(); about.Text = StringParser.Parse("${res:XML.MainMenu.HelpMenu.About}"); about.Click += new System.EventHandler(AboutClick); ToolStripMenuItem help = new ToolStripMenuItem(); help.Text = StringParser.Parse("${res:ComponentInspector.ObjectBrowserForm.ShowHelpMenuItem}"); help.Click += new System.EventHandler(HelpClick); ToolStripMenuItem helpMenuItem = new ToolStripMenuItem(); helpMenuItem.DropDownItems.AddRange(new ToolStripMenuItem[] { help, about }); helpMenuItem.Text = StringParser.Parse("${res:XML.MainMenu.HelpMenu}"); MainMenuStrip = new MenuStrip(); Controls.Add(MainMenuStrip); MainMenuStrip.Items.Add(fileMenuItem); MainMenuStrip.Items.Add(editMenu); MainMenuStrip.Items.Add(actionMenu); MainMenuStrip.Items.Add(viewMenuItem); if (LocalPrefs.Get(LocalPrefs.DEV_MENU) != null) { MainMenuStrip.Items.Add(remoteMenuItem); } MainMenuStrip.Items.Add(helpMenuItem); }