本文整理汇总了C#中Microsoft.VisualStudio.Shell.OleMenuCommandService类的典型用法代码示例。如果您正苦于以下问题:C# OleMenuCommandService类的具体用法?C# OleMenuCommandService怎么用?C# OleMenuCommandService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OleMenuCommandService类属于Microsoft.VisualStudio.Shell命名空间,在下文中一共展示了OleMenuCommandService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: HandlebarsMenu
public HandlebarsMenu(DTE2 dte, OleMenuCommandService mcs)
{
Mef.SatisfyImportsOnce(this);
_contentType = ContentTypes.GetContentType("Handlebars");
if (_contentType != null)
_extensions = FileExtensionRegistry.GetFileExtensionSet(_contentType);
_dte = dte;
_mcs = mcs;
}
开发者ID:GProulx,项目名称:WebEssentials2013,代码行数:11,代码来源:Handlebars.cs
示例17: AddCommand
private void AddCommand(OleMenuCommandService mcs, uint commandId)
{
OleMenuCommand menuItemCommand = new OleMenuCommand(
delegate(object sender, EventArgs e)
{
RefreshAppPoolMenu(mcs);
},
new CommandID(GuidList.guidNielsV_AttachToAppPoolCmdSet, (int)commandId));
//menuItemCommand.BeforeQueryStatus += (s, e) => menuItemCommand.Visible = isVisible((GeneralOptionsPage)this.GetDialogPage(typeof(GeneralOptionsPage)));
mcs.AddCommand(menuItemCommand);
}
开发者ID:Niels-V,项目名称:AttachToAppPool,代码行数:11,代码来源:NielsV.AttachToAppPoolPackage.cs
示例18: CreateMenuCommands
private void CreateMenuCommands(OleMenuCommandService mcs)
{
CommandID runLonestarOnActiveViewMenuCommandID = new CommandID(GuidList.guidLonestarCmdSet, (int)PkgCmdIDList.runLonestarOnActiveView);
CommandID runLonestarOnSolutionMenuCommandID = new CommandID(GuidList.guidLonestarCmdSet, (int)PkgCmdIDList.runLonestarOnSolution);
MenuCommandController controller = new MenuCommandController(this);
MenuCommand menuItem = new MenuCommand(controller.RunLonestarOnActiveView, runLonestarOnActiveViewMenuCommandID);
mcs.AddCommand(menuItem);
MenuCommand runOnSolution = new MenuCommand(controller.RunLonestarOnSolution, runLonestarOnSolutionMenuCommandID);
mcs.AddCommand(runOnSolution);
}
开发者ID:BenHall,项目名称:lonestar,代码行数:11,代码来源:LonestarPackage.cs
示例19: GitStatusBarManager
protected GitStatusBarManager(Guid commandSetGuid, int branchMenuCmId, int branchCommandMenuCmId, int repositoryCommandMenuCmId, IServiceContainer serviceProvider, IStatusBarService statusBarService)
{
BranchMenuCmId = branchMenuCmId;
BranchCommandMenuCmId = branchCommandMenuCmId;
RepositoryCommandMenuCmId = repositoryCommandMenuCmId;
StatusBarService = statusBarService;
CommandSetGuid = commandSetGuid;
_menuCommandService = serviceProvider.GetService(typeof(IMenuCommandService)) as MsVsShell.OleMenuCommandService;
_serviceProvider = serviceProvider;
_branchCommandMenuCommands = new List<Tuple<string, MenuCommand>>();
}
开发者ID:Frrank1,项目名称:Git-Source-Control-Provider,代码行数:12,代码来源:GitStatusBarManager.cs
示例20: Plugin
public Plugin(DTE2 application, IVsProfferCommands3 profferCommands, ImageList icons, OleMenuCommandService oleMenuCommandService, string panelName, string connectPath, object options)
{
// TODO: This can be figured out from traversing the assembly and locating the Connect class...
m_connectPath = connectPath;
m_application = application;
m_panelName = panelName;
m_profferCommands = profferCommands;
m_oleMenuCommandService = oleMenuCommandService;
mOptions = options;
m_icons = icons;
}
开发者ID:Nexuapex,项目名称:niftyplugins,代码行数:12,代码来源:Plugin.cs
注:本文中的Microsoft.VisualStudio.Shell.OleMenuCommandService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论