當前位置: 首頁>>代碼示例>>C#>>正文


C# Shell.OleMenuCommandService類代碼示例

本文整理匯總了C#中Microsoft.VisualStudio.Shell.OleMenuCommandService的典型用法代碼示例。如果您正苦於以下問題:C# OleMenuCommandService類的具體用法?C# OleMenuCommandService怎麽用?C# OleMenuCommandService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OleMenuCommandService類屬於Microsoft.VisualStudio.Shell命名空間,在下文中一共展示了OleMenuCommandService類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Commands

 public Commands(IVsExtensionRepository repo, IVsExtensionManager manager, OleMenuCommandService mcs, IVsOutputWindowPane outputPane)
 {
     _repository = repo;
     _manager = manager;
     _mcs = mcs;
     _outputPane = outputPane;
 }
開發者ID:benmccallum,項目名稱:BulkExtensionManager,代碼行數:7,代碼來源:Commands.cs

示例2: RegisterTo

 public void RegisterTo(OleMenuCommandService menuCommandService, SpecFlowCmdSet commandId)
 {
     CommandID menuCommandID = new CommandID(GuidList.guidSpecFlowCmdSet, (int)(uint)commandId);
     OleMenuCommand menuItem = new OleMenuCommand(InvokeHandler, menuCommandID);
     menuItem.BeforeQueryStatus += BeforeQueryStatusHandler;
     menuCommandService.AddCommand(menuItem);
 }
開發者ID:paulroho,項目名稱:SpecFlow.VisualStudio,代碼行數:7,代碼來源:MenuCommandHandler.cs

示例3: CreateToolWindows

 private void CreateToolWindows(OleMenuCommandService mcs)
 {
     WindowLauncher launcher = new WindowLauncher(this);
     CommandID toolwndCommandID = new CommandID(GuidList.guidLonestarCmdSet, (int)PkgCmdIDList.resultsWindow);
     MenuCommand menuToolWin = new MenuCommand(launcher.ShowToolWindow, toolwndCommandID);
     mcs.AddCommand( menuToolWin );
 }
開發者ID:BenHall,項目名稱:lonestar,代碼行數:7,代碼來源:LonestarPackage.cs

示例4: ProjectSettingsMenu

        public ProjectSettingsMenu(DTE2 dte, OleMenuCommandService mcs)
        {
            _dte = dte;
            _mcs = mcs;

            _dte.Events.SolutionEvents.Opened += SolutionEvents_Opened;
        }
開發者ID:jordanovski,項目名稱:WebEssentials2013,代碼行數:7,代碼來源:ProjectSettings.cs

示例5: CSharpResetInteractiveMenuCommand

 public CSharpResetInteractiveMenuCommand(
     OleMenuCommandService menuCommandService,
     IVsMonitorSelection monitorSelection,
     IComponentModel componentModel)
     : base(ContentTypeNames.CSharpContentType, menuCommandService, monitorSelection, componentModel)
 {
 }
開發者ID:CAPCHIK,項目名稱:roslyn,代碼行數:7,代碼來源:CSharpResetInteractiveMenuCommand.cs

示例6: SetupCommands

        public void SetupCommands(OleMenuCommandService commandService)
        {
            if (Package.DocumentManager == null)
            {
                return;
            }

            var guid = typeof(RestoreTabsListCommandIds).GUID;

            var commandId = new CommandID(guid, (int)RestoreTabsListCommandIds.RestoreTabsListPlaceholder);
            var command = new OleMenuCommand(null, commandId);
            command.BeforeQueryStatus += RestoreTabsListPlaceholderCommandOnBeforeQueryStatus;
            commandService.AddCommand(command);

            for (var i = (int)RestoreTabsListCommandIds.RestoreTabsListStart; i <= (int)RestoreTabsListCommandIds.RestoreTabsListEnd; i++)
            {
                commandId = new CommandID(guid, i);
                command = new OleMenuCommand(ExecuteRestoreTabsCommand, commandId);
                command.BeforeQueryStatus += RestoreTabsCommandOnBeforeQueryStatus;
                commandService.AddCommand(command);

                var index = GetGroupIndex(command);
                Package.Environment.SetKeyBindings(command, $"Global::Ctrl+D,{index}", $"Text Editor::Ctrl+D,{index}");
            }
        }
開發者ID:k4gdw,項目名稱:SaveAllTheTabs,代碼行數:25,代碼來源:RestoreTabsListCommands.cs

示例7: AddAttachToCommand

        private void AddAttachToCommand(OleMenuCommandService mcs, uint commandId, Func<GeneralOptionsPage, bool> isVisible, params string[] programsToAttach)
        {
            var menuItemCommand = new OleMenuCommand((sender, args) => Attach(programsToAttach),
                new CommandID(GuidList.guidAttachToCmdSet, (int)commandId));

            menuItemCommand.BeforeQueryStatus += (s, e) => menuItemCommand.Visible = isVisible((GeneralOptionsPage)GetDialogPage(typeof(GeneralOptionsPage)));
            mcs.AddCommand(menuItemCommand);
        }
開發者ID:dziedrius,項目名稱:AttachTo,代碼行數:8,代碼來源:AttachToPackage.cs

示例8: ClearCache

        private ClearCache(OleMenuCommandService commandService, AsyncPackage package)
        {
            ServiceProvider = package;

            var commandID = new CommandID(PackageGuids.guidClearCachePackageCmdSet, PackageIds.ClearCacheId);
            var button = new MenuCommand(DeleteCacheFolder, commandID);
            commandService.AddCommand(button);
        }
開發者ID:madskristensen,項目名稱:ClearComponentCache,代碼行數:8,代碼來源:ClearCache.cs

示例9: HubsT4Menu

 public HubsT4Menu(DTE2 dte, OleMenuCommandService mcs)
 {
     _dte = dte;
     _mcs = mcs;
     _dependencies = new List<string>();
     _dependencies.Add(@"\typings\jquery\jquery.d.ts");
     _dependencies.Add(@"\typings\signalr\signalr.d.ts");
 }
開發者ID:Gordon-Beeming,項目名稱:WebEssentials2013,代碼行數:8,代碼來源:HubsT4.cs

示例10: SetDependencies

        //Todo: See if this can be refactored with better IoC
        private void SetDependencies()
        {
            var dte = ((DTE)GetService(typeof(DTE)));
            var solution = dte != null ? dte.Solution : null;

            _commandService = (OleMenuCommandService) GetService(typeof (IMenuCommandService));
            _tortoiseGitLauncherService = (ITortoiseGitLauncherService) GetService(typeof (TortoiseGitLauncherService))
                ?? new TortoiseGitLauncherService(new ProcessManagerService(), solution);
        }
開發者ID:duncansmart,項目名稱:TortoiseGitToolbar,代碼行數:10,代碼來源:TortoiseGitToolbarPackage.cs

示例11: AddCommand

        /// <summary>
        /// Add buttons to the toolbar. Specify the target toolbar, which button to place, and 
        /// the corresponding function call.
        /// </summary>
        private void AddCommand(OleMenuCommandService mcs, int cmdid, EventHandler handler)
        {
            // Create the command for the tool window
            CommandID commandID    = new CommandID(GuidList.guidCommandTargetRGBCmdSet, cmdid);
            OleMenuCommand command = new OleMenuCommand(handler, commandID);
            command.BeforeQueryStatus += OnBeforeQueryStatus;

            mcs.AddCommand(command);
        }
開發者ID:Sunzhuokai,項目名稱:VSSDK-Extensibility-Samples,代碼行數:13,代碼來源:RGBToolWindow.cs

示例12: EnableReloadCommand

        EnableReloadCommand(Package package, OleMenuCommandService commandService)
        {
            _package = package;

            var id = new CommandID(PackageGuids.guidBrowserReloadCmdSet, PackageIds.EnableReloadCommandId);
            var cmd = new OleMenuCommand(Execute, id);
            cmd.BeforeQueryStatus += BeforeQueryStatus;
            commandService.AddCommand(cmd);
        }
開發者ID:madskristensen,項目名稱:BrowserReloadOnSave,代碼行數:9,代碼來源:EnableReloadCommand.cs

示例13: AddCommand

        private AddCommand(OleMenuCommandService commandService, DTE2 dte)
        {
            _dte = dte;

            var cmdAddCommand = new CommandID(PackageGuids.guidCommandCmdSet, PackageIds.AddCommandId);
            var addCommandItem = new OleMenuCommand(AddCommandToFile, cmdAddCommand);
            addCommandItem.BeforeQueryStatus += BeforeQueryStatus;
            commandService.AddCommand(addCommandItem);
        }
開發者ID:madskristensen,項目名稱:CommandTaskRunner,代碼行數:9,代碼來源:AddCommand.cs

示例14: MarkdownMenu

        public MarkdownMenu(DTE2 dte, OleMenuCommandService mcs)
        {
            Mef.SatisfyImportsOnce(this);
            _contentType = ContentTypes.GetContentType("Markdown");
            _extensions = FileExtensionRegistry.GetFileExtensionSet(_contentType);

            _dte = dte;
            _mcs = mcs;
        }
開發者ID:kodybrown,項目名稱:WebEssentials2013,代碼行數:9,代碼來源:Markdown.cs

示例15: AddMenuCommandHandlers

 private void AddMenuCommandHandlers()
 {
     _mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
     if (null != _mcs)
     {
         CommandID menuCommandID = new CommandID(GuidList.guidVisualStudio_MenuExtensionCmdSet, (int)PkgCmdIDList.cmdidLinkOpenRiaServicesProject);
         MenuCommand menuItem = new OleMenuCommand(LinkRiaProjectCallback, null, BeforeQueryStatusForAddPackageDialog, menuCommandID);
         _mcs.AddCommand(menuItem);
     }
 }
開發者ID:OpenRIAServices,項目名稱:OpenRiaServices,代碼行數:10,代碼來源:OpenRiaServicesPackage.VisualStudio.Installer.cs


注:本文中的Microsoft.VisualStudio.Shell.OleMenuCommandService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。