void CreateMenuItems() { refactorMainMenu = new RefactorMenu(); refactorMainMenu.ConvertForeachToFor.Click += ConvertForeachToForOnClick; refactorMainMenu.ConvertForeachToKeyValueIterator.Click += ConvertForeachToKeyValueIteratorOnClick; CompletionMenuProvider.Menu = refactorMainMenu; }
/// <summary> /// Creates the required menu items /// </summary> private void CreateMenuItems() { MenuStrip mainMenu = PluginBase.MainForm.MenuStrip; ContextMenuStrip editorMenu = PluginBase.MainForm.EditorMenu; this.refactorMainMenu = new RefactorMenu(true); this.refactorMainMenu.RenameMenuItem.Click += new EventHandler(this.RenameClicked); this.refactorMainMenu.OrganizeMenuItem.Click += new EventHandler(this.OrganizeImportsClicked); this.refactorMainMenu.TruncateMenuItem.Click += new EventHandler(this.TruncateImportsClicked); this.refactorMainMenu.ExtractMethodMenuItem.Click += new EventHandler(this.ExtractMethodClicked); this.refactorMainMenu.DelegateMenuItem.Click += new EventHandler(this.DelegateMethodsClicked); this.refactorMainMenu.ExtractLocalVariableMenuItem.Click += new EventHandler(this.ExtractLocalVariableClicked); this.refactorMainMenu.CodeGeneratorMenuItem.Click += new EventHandler(this.CodeGeneratorMenuItemClicked); this.refactorContextMenu = new RefactorMenu(false); this.refactorContextMenu.RenameMenuItem.Click += new EventHandler(this.RenameClicked); this.refactorContextMenu.OrganizeMenuItem.Click += new EventHandler(this.OrganizeImportsClicked); this.refactorContextMenu.TruncateMenuItem.Click += new EventHandler(this.TruncateImportsClicked); this.refactorContextMenu.DelegateMenuItem.Click += new EventHandler(this.DelegateMethodsClicked); this.refactorContextMenu.ExtractMethodMenuItem.Click += new EventHandler(this.ExtractMethodClicked); this.refactorContextMenu.ExtractLocalVariableMenuItem.Click += new EventHandler(this.ExtractLocalVariableClicked); this.refactorContextMenu.CodeGeneratorMenuItem.Click += new EventHandler(this.CodeGeneratorMenuItemClicked); this.surroundContextMenu = new SurroundMenu(); editorMenu.Items.Insert(3, this.refactorContextMenu); editorMenu.Items.Insert(4, this.surroundContextMenu); mainMenu.Items.Insert(5, this.refactorMainMenu); ToolStripMenuItem searchMenu = PluginBase.MainForm.FindMenuItem("SearchMenu") as ToolStripMenuItem; this.viewReferencesItem = new ToolStripMenuItem(TextHelper.GetString("Label.FindAllReferences"), null, new EventHandler(this.FindAllReferencesClicked)); this.editorReferencesItem = new ToolStripMenuItem(TextHelper.GetString("Label.FindAllReferences"), null, new EventHandler(this.FindAllReferencesClicked)); PluginBase.MainForm.RegisterShortcutItem("SearchMenu.ViewReferences", this.viewReferencesItem); searchMenu.DropDownItems.Add(new ToolStripSeparator()); searchMenu.DropDownItems.Add(this.viewReferencesItem); editorMenu.Items.Insert(7, this.editorReferencesItem); }
/// <summary> /// Creates the required menu items /// </summary> private void CreateMenuItems() { MenuStrip mainMenu = PluginBase.MainForm.MenuStrip; ContextMenuStrip editorMenu = PluginBase.MainForm.EditorMenu; this.refactorMainMenu = new RefactorMenu(this.settingObject, true); this.refactorMainMenu.RenameMenuItem.Click += new EventHandler(this.RenameClicked); this.refactorMainMenu.OrganizeMenuItem.Click += new EventHandler(this.OrganizeImportsClicked); this.refactorMainMenu.TruncateMenuItem.Click += new EventHandler(this.TruncateImportsClicked); this.refactorMainMenu.ExtractMethodMenuItem.Click += new EventHandler(this.ExtractMethodClicked); this.refactorMainMenu.DelegateMenuItem.Click += new EventHandler(this.DelegateMethodsClicked); this.refactorMainMenu.ExtractLocalVariableMenuItem.Click += new EventHandler(this.ExtractLocalVariableClicked); this.refactorContextMenu = new RefactorMenu(this.settingObject, false); this.refactorContextMenu.RenameMenuItem.Click += new EventHandler(this.RenameClicked); this.refactorContextMenu.OrganizeMenuItem.Click += new EventHandler(this.OrganizeImportsClicked); this.refactorContextMenu.TruncateMenuItem.Click += new EventHandler(this.TruncateImportsClicked); this.refactorContextMenu.DelegateMenuItem.Click += new EventHandler(this.DelegateMethodsClicked); this.refactorContextMenu.ExtractMethodMenuItem.Click += new EventHandler(this.ExtractMethodClicked); this.refactorContextMenu.ExtractLocalVariableMenuItem.Click += new EventHandler(this.ExtractLocalVariableClicked); this.surroundContextMenu = new SurroundMenu(); editorMenu.Opening += new CancelEventHandler(this.EditorMenuOpening); mainMenu.MenuActivate += new EventHandler(this.MainMenuActivate); editorMenu.Items.Insert(3, this.refactorContextMenu); editorMenu.Items.Insert(4, this.surroundContextMenu); mainMenu.Items.Insert(5, this.refactorMainMenu); ToolStripMenuItem searchMenu = PluginBase.MainForm.FindMenuItem("SearchMenu") as ToolStripMenuItem; this.viewReferencesItem = new ToolStripMenuItem(TextHelper.GetString("Label.FindAllReferences"), null, new EventHandler(this.FindAllReferencesClicked)); this.editorReferencesItem = new ToolStripMenuItem(TextHelper.GetString("Label.FindAllReferences"), null, new EventHandler(this.FindAllReferencesClicked)); this.editorReferencesItem.ShortcutKeys = this.settingObject.FindRefsShortcut; this.viewReferencesItem.ShortcutKeys = this.settingObject.FindRefsShortcut; searchMenu.DropDownItems.Add(new ToolStripSeparator()); searchMenu.DropDownItems.Add(this.viewReferencesItem); editorMenu.Items.Insert(7, this.editorReferencesItem); this.ApplyIgnoredKeys(); }