Beispiel #1
0
 private void HideAllClojureEditorMenuCommands()
 {
     List<int> allCommandIds = new List<int>() {11, 12, 13, 14, 15};
     DTE2 dte = (DTE2) GetService(typeof (DTE));
     OleMenuCommandService menuCommandService = (OleMenuCommandService) GetService(typeof (IMenuCommandService));
     List<MenuCommand> menuCommands = new List<MenuCommand>();
     foreach (int commandId in allCommandIds) menuCommands.Add(new MenuCommand((o, s) => { }, new CommandID(Guids.GuidClojureExtensionCmdSet, commandId)));
     MenuCommandListHider hider = new MenuCommandListHider(menuCommandService, menuCommands);
     dte.Events.WindowEvents.WindowActivated += (o, e) => hider.HideMenuCommands();
 }
Beispiel #2
0
		private void HideAllClojureEditorMenuCommands()
		{
			List<CommandID> allCommandIds = new List<CommandID>() { CommandIDs.LoadProjectIntoActiveRepl, CommandIDs.LoadFileIntoActiveRepl, CommandIDs.LoadActiveDocumentIntoRepl, CommandIDs.SwitchReplNamespaceToActiveDocument, CommandIDs.LoadSelectedTextIntoRepl };
			DTE2 dte = (DTE2)GetService(typeof(DTE));
			OleMenuCommandService menuCommandService = (OleMenuCommandService)GetService(typeof(IMenuCommandService));
			List<MenuCommand> menuCommands = new List<MenuCommand>();
			foreach (CommandID commandId in allCommandIds) menuCommands.Add(new MenuCommand((o, s) => { }, commandId));
			MenuCommandListHider hider = new MenuCommandListHider(menuCommandService, menuCommands);
			dte.Events.WindowEvents.WindowActivated += (o, e) => hider.HideMenuCommands();
		}