本文整理汇总了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;
}
示例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);
}
示例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 );
}
示例4: ProjectSettingsMenu
public ProjectSettingsMenu(DTE2 dte, OleMenuCommandService mcs)
{
_dte = dte;
_mcs = mcs;
_dte.Events.SolutionEvents.Opened += SolutionEvents_Opened;
}
示例5: CSharpResetInteractiveMenuCommand
public CSharpResetInteractiveMenuCommand(
OleMenuCommandService menuCommandService,
IVsMonitorSelection monitorSelection,
IComponentModel componentModel)
: base(ContentTypeNames.CSharpContentType, menuCommandService, monitorSelection, componentModel)
{
}
示例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}");
}
}
示例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);
}
示例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);
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例14: MarkdownMenu
public MarkdownMenu(DTE2 dte, OleMenuCommandService mcs)
{
Mef.SatisfyImportsOnce(this);
_contentType = ContentTypes.GetContentType("Markdown");
_extensions = FileExtensionRegistry.GetFileExtensionSet(_contentType);
_dte = dte;
_mcs = mcs;
}
示例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