• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IMenuCommandService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IMenuCommandService的典型用法代码示例。如果您正苦于以下问题:C# IMenuCommandService类的具体用法?C# IMenuCommandService怎么用?C# IMenuCommandService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IMenuCommandService类属于命名空间,在下文中一共展示了IMenuCommandService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Initialize

        /// <summary>
        /// Hook up the context menu handlers.
        /// </summary>
        public void Initialize(IMenuCommandService menuCommandService)
        {
            if (menuCommandService != null)
            {
                _addMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.AddAnalyzer, AddAnalyzerHandler);
                _projectAddMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.ProjectAddAnalyzer, AddAnalyzerHandler);
                _projectContextAddMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.ProjectContextAddAnalyzer, AddAnalyzerHandler);
                _referencesContextAddMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.ReferencesContextAddAnalyzer, AddAnalyzerHandler);

                _removeMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.RemoveAnalyzer, RemoveAnalyzerHandler);

                _openRuleSetMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.OpenRuleSet, OpenRuleSetHandler);

                _setSeverityErrorMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.SetSeverityError, SetSeverityHandler);
                _setSeverityWarningMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.SetSeverityWarning, SetSeverityHandler);
                _setSeverityInfoMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.SetSeverityInfo, SetSeverityHandler);
                _setSeverityHiddenMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.SetSeverityHidden, SetSeverityHandler);
                _setSeverityNoneMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.SetSeverityNone, SetSeverityHandler);

                UpdateMenuItemVisibility();
                UpdateMenuItemsChecked();

                if (_tracker != null)
                {
                    _tracker.SelectedHierarchyChanged += SelectedHierarchyChangedHandler;
                    _tracker.SelectedDiagnosticItemsChanged += SelectedDiagnosticItemsChangedHandler;
                    _tracker.SelectedItemIdChanged += SelectedItemIdChangedHandler;
                }

                var buildManager = (IVsSolutionBuildManager)_serviceProvider.GetService(typeof(SVsSolutionBuildManager));
                uint cookie;
                buildManager.AdviseUpdateSolutionEvents(this, out cookie);
            }
        }
开发者ID:JinGuoGe,项目名称:roslyn,代码行数:37,代码来源:AnalyzersCommandHandler.cs


示例2: InitializeCommands

        private void InitializeCommands(XmlRepository repository, IConfiguration configuration, IMenuCommandService commandService)
        {
            var activeDocument = new ActiveDocument();

            var subMenu = CreateSubMenu(activeDocument);
            commandService.AddCommand(subMenu);

            var copyGenericXPathCommand = new CopyXPathCommand(Symbols.CommandIDs.CopyGenericXPath, repository, activeDocument, () => new XPathWriter(new[] {new AttributeFilter(configuration.AlwaysDisplayedAttributes)}), new CommandTextFormatter());
            commandService.AddCommand(copyGenericXPathCommand);

            var copyAbsoluteXPathCommand = new CopyXPathCommand(Symbols.CommandIDs.CopyAbsoluteXPath, repository, activeDocument, () => new AbsoluteXPathWriter(new[] {new AttributeFilter(configuration.AlwaysDisplayedAttributes)}), new CommandTextFormatter());
            commandService.AddCommand(copyAbsoluteXPathCommand);

            var copyDistinctXPathCommand = new CopyXPathCommand(Symbols.CommandIDs.CopyDistinctXPath, repository, activeDocument, () => new XPathWriter(new[] {new AttributeFilter(configuration.AlwaysDisplayedAttributes), new DistinctAttributeFilter(configuration.PreferredAttributeCandidates)}), new CommandTextFormatter());
            commandService.AddCommand(copyDistinctXPathCommand);

            var copySimplifiedXPathCommand = new CopyXPathCommand(Symbols.CommandIDs.CopySimplifiedXPath, repository, activeDocument, () => new SimplifiedXPathWriter(new[] { new AttributeFilter(configuration.AlwaysDisplayedAttributes) }), new TrimCommandTextFormatter());
            commandService.AddCommand(copySimplifiedXPathCommand);

            var showXPathWorkbenchCommand = new ShowXPathWorkbenchCommand(this, commandService, Symbols.CommandIDs.ShowXPathWorkbench, repository, activeDocument);
            commandService.AddCommand(showXPathWorkbenchCommand.Command);

            var copyXmlStructureCommand = new CopyXmlStructureCommand(Symbols.CommandIDs.CopyXmlStructure, repository, activeDocument, () => new XmlStructureWriter(), new CommandTextFormatter());
            commandService.AddCommand(copyXmlStructureCommand);
        }
开发者ID:uli-weltersbach,项目名称:XPathInformation,代码行数:25,代码来源:XPathInformationPackage.cs


示例3: AddSuppressionsCommandHandlers

 private void AddSuppressionsCommandHandlers(IMenuCommandService menuCommandService)
 {
     AddCommand(menuCommandService, ID.RoslynCommands.AddSuppressions, delegate { }, OnAddSuppressionsStatus);
     AddCommand(menuCommandService, ID.RoslynCommands.AddSuppressionsInSource, OnAddSuppressionsInSource, OnAddSuppressionsInSourceStatus);
     AddCommand(menuCommandService, ID.RoslynCommands.AddSuppressionsInSuppressionFile, OnAddSuppressionsInSuppressionFile, OnAddSuppressionsInSuppressionFileStatus);
     AddCommand(menuCommandService, ID.RoslynCommands.RemoveSuppressions, OnRemoveSuppressions, OnRemoveSuppressionsStatus);
 }
开发者ID:jkotas,项目名称:roslyn,代码行数:7,代码来源:VisualStudioDiagnosticListTableCommandHandler.cs


示例4: CommandSet

 public CommandSet(ISite site)
 {
     this.site = site;
     this.eventService = (IEventHandlerService) site.GetService(typeof(IEventHandlerService));
     this.eventService.EventHandlerChanged += new EventHandler(this.OnEventHandlerChanged);
     IDesignerHost host = (IDesignerHost) site.GetService(typeof(IDesignerHost));
     if (host != null)
     {
         host.Activated += new EventHandler(this.UpdateClipboardItems);
     }
     this.statusCommandUI = new StatusCommandUI(site);
     IUIService uiService = site.GetService(typeof(IUIService)) as IUIService;
     this.commandSet = new CommandSetItem[] {
         new CommandSetItem(this, new EventHandler(this.OnStatusDelete), new EventHandler(this.OnMenuDelete), StandardCommands.Delete, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusCopy), new EventHandler(this.OnMenuCopy), StandardCommands.Copy, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusCut), new EventHandler(this.OnMenuCut), StandardCommands.Cut, uiService), new ImmediateCommandSetItem(this, new EventHandler(this.OnStatusPaste), new EventHandler(this.OnMenuPaste), StandardCommands.Paste, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusSelectAll), new EventHandler(this.OnMenuSelectAll), StandardCommands.SelectAll, true, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAlways), new EventHandler(this.OnMenuDesignerProperties), MenuCommands.DesignerProperties, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyCancel), MenuCommands.KeyCancel, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyCancel), MenuCommands.KeyReverseCancel, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusPrimarySelection), new EventHandler(this.OnKeyDefault), MenuCommands.KeyDefaultAction, true, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveUp, true, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveDown, true, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveLeft, true, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveRight, true), new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyNudgeUp, true, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyNudgeDown, true, uiService), new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyNudgeLeft, true, uiService),
         new CommandSetItem(this, new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyMove), MenuCommands.KeyNudgeRight, true, uiService)
      };
     this.selectionService = (ISelectionService) site.GetService(typeof(ISelectionService));
     if (this.selectionService != null)
     {
         this.selectionService.SelectionChanged += new EventHandler(this.OnSelectionChanged);
     }
     this.menuService = (IMenuCommandService) site.GetService(typeof(IMenuCommandService));
     if (this.menuService != null)
     {
         for (int i = 0; i < this.commandSet.Length; i++)
         {
             this.menuService.AddCommand(this.commandSet[i]);
         }
     }
     IDictionaryService service = site.GetService(typeof(IDictionaryService)) as IDictionaryService;
     if (service != null)
     {
         service.SetValue(typeof(CommandID), new CommandID(new Guid("BA09E2AF-9DF2-4068-B2F0-4C7E5CC19E2F"), 0));
     }
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:35,代码来源:CommandSet.cs


示例5: Register

 public virtual void Register(IMenuCommandService mcs)
 {
     var menuCommandID = new CommandID(GuidList.GuidEasyCodeCmdSet, CommandID);
     var menuCommand = new OleMenuCommand(ExcuteCommand, menuCommandID);
     menuCommand.BeforeQueryStatus += new EventHandler(menuCommand_BeforeQueryStatus);
     mcs.AddCommand(menuCommand);
 }
开发者ID:hhahh2011,项目名称:CH.EasyCode,代码行数:7,代码来源:AbstractCommand.cs


示例6: ShowContextMenu

        public static void ShowContextMenu(IMenuCommandService service, Control owner, int x, int y)
        {
            var menu = new ContextMenuStrip();
            menu.Items.AddRange(GetMenuItems(service.Verbs));
            menu.Show(owner, x, y);

        }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:7,代码来源:MenuService.cs


示例7: MenuConfigure

 public MenuConfigure(ConfigureMenuCallback configureMenuCallback, DisableMenuConfigure disableMenuConfigure, IMenuCommandService menuCommandService, MenuStatusChecker menuStatusChecker)
 {
     this.configureMenuCallback = configureMenuCallback;
     this.disableMenuConfigure = disableMenuConfigure;
     this.menuCommandService = menuCommandService;
     this.menuStatusChecker = menuStatusChecker;
 }
开发者ID:paulcbetts,项目名称:Fody,代码行数:7,代码来源:MenuConfigure.cs


示例8: AddTo

		public void AddTo (IMenuCommandService commands)
		{
			commands.AddCommand (new MenuCommand (Copy, StandardCommands.Copy));
			commands.AddCommand (new MenuCommand (Cut, StandardCommands.Cut));
			commands.AddCommand (new MenuCommand (Paste, StandardCommands.Paste));
			commands.AddCommand (new MenuCommand (Delete, StandardCommands.Delete));
			commands.AddCommand (new MenuCommand (SelectAll, StandardCommands.SelectAll));
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:DefaultMenuCommands.cs


示例9: RegisterCommand

 private OleMenuCommand RegisterCommand(Guid guidId, int id, IMenuCommandService menuCommandService)
 {
     var menuCommandID = new CommandID(guidId, id);
     var menuItem = new OleMenuCommand(Exec, menuCommandID);
     menuItem.BeforeQueryStatus += QueryStatus;
     menuCommandService.AddCommand(menuItem);
     return menuItem;
 }
开发者ID:modulexcite,项目名称:tfsproductivitypack,代码行数:8,代码来源:AbstractCommand.cs


示例10: MenuConfigure

 public MenuConfigure(CurrentProjectFinder currentProjectFinder, ExceptionDialog exceptionDialog, ConfigureMenuCallback configureMenuCallback, DisableMenuConfigure disableMenuConfigure, IMenuCommandService menuCommandService)
 {
     this.exceptionDialog = exceptionDialog;
     this.configureMenuCallback = configureMenuCallback;
     this.disableMenuConfigure = disableMenuConfigure;
     this.menuCommandService = menuCommandService;
     this.currentProjectFinder = currentProjectFinder;
 }
开发者ID:sachhi,项目名称:costura,代码行数:8,代码来源:MenuConfigure.cs


示例11: ORMModelBrowserCommandSet

			public ORMModelBrowserCommandSet(IServiceProvider provider, IMenuCommandService menuService)
			{
				myServiceProvider = provider;
				myMenuService = menuService;
				#region command array
				myCommands = new MenuCommand[]{
					new DynamicStatusMenuCommand(
					new EventHandler(OnStatusDelete),
					new EventHandler(OnMenuDelete),
					StandardCommands.Delete)
					,new DynamicStatusMenuCommand(
					new EventHandler(OnStatusEditLabel),
					new EventHandler(OnMenuEditLabel),
					EditLabelCommandID)
					,new DynamicStatusMenuCommand(
					new EventHandler(OnStatusExclusiveOrDecoupler),
					new EventHandler(OnMenuExclusiveOrDecoupler),
					ORMDesignerDocView.ORMDesignerCommandIds.ExclusiveOrDecoupler)
					,new DynamicDiagramCommand(
					new EventHandler(OnStatusDiagramList),
					new EventHandler(OnMenuDiagramList),
					ORMDesignerDocView.ORMDesignerCommandIds.DiagramList)
					,new DynamicDiagramCommand(
					new EventHandler(OnStatusDiagramList),
					new EventHandler(OnMenuDiagramSpyDiagramList),
					ORMDesignerDocView.ORMDesignerCommandIds.DiagramSpyDiagramList)
					,new DynamicStatusMenuCommand(
					new EventHandler(OnStatusSelectShapeInDocumentWindow),
					new EventHandler(OnMenuSelectShapeInDocumentWindow),
					ORMDesignerDocView.ORMDesignerCommandIds.SelectInDocumentWindow)
					,new DynamicStatusMenuCommand(
					new EventHandler(OnStatusSelectShapeInDiagramSpy),
					new EventHandler(OnMenuSelectShapeInDiagramSpy),
					ORMDesignerDocView.ORMDesignerCommandIds.SelectInDiagramSpy)
					,new DynamicFreeFormCommand(
					new EventHandler(OnStatusFreeFormCommand),
					new EventHandler(OnMenuFreeFormCommand),
					ORMDesignerDocView.ORMDesignerCommandIds.FreeFormCommandList)
					,new DynamicStatusMenuCommand(
					new EventHandler(OnStatusIncludeInGroup),
					new EventHandler(OnMenuIncludeInGroup),
					ORMDesignerDocView.ORMDesignerCommandIds.IncludeInGroup)
					,new DynamicStatusMenuCommand(
					new EventHandler(OnStatusIncludeInNewGroup),
					new EventHandler(OnMenuIncludeInNewGroup),
					ORMDesignerDocView.ORMDesignerCommandIds.IncludeInNewGroup)
					,new DynamicIncludeInGroupCommand(
					new EventHandler(OnStatusIncludeInGroupList),
					new EventHandler(OnMenuIncludeInGroupList),
					ORMDesignerDocView.ORMDesignerCommandIds.IncludeInGroupList)
					,new DynamicDeleteFromGroupCommand(
					new EventHandler(OnStatusDeleteFromGroupList),
					new EventHandler(OnMenuDeleteFromGroupList),
					ORMDesignerDocView.ORMDesignerCommandIds.DeleteFromGroupList)
				};
				#endregion //command array
				AddCommands(myCommands);
			}
开发者ID:cjheath,项目名称:NORMA,代码行数:58,代码来源:ORMModelBrowserCommandSet.cs


示例12: CompareToBranchCommand

 public CompareToBranchCommand(IMenuCommandService menuCommandService, ILogger _logger, ITFSVersionControl _tfs)
 {
     branches = new List<string>();
     logger = _logger;
     tfsVersionControl = _tfs;
     CommandID compareToBranchId = new CommandID(GuidList.guidTFSProductivityPackCmdSet, PkgCmdIDList.cmdIdDynamicCompareToBranchCommand);
     compareToBranchOleCommand = new OleDynamicCommand(compareToBranchId, IsValidDynamicItem, Exec, QueryStatus);
     menuCommandService.AddCommand(compareToBranchOleCommand);
 }
开发者ID:modulexcite,项目名称:tfsproductivitypack,代码行数:9,代码来源:CompareToBranchCommand.cs


示例13: DesignerActionKeyboardBehavior

 public DesignerActionKeyboardBehavior(DesignerActionPanel panel, IServiceProvider serviceProvider, BehaviorService behaviorService) : base(true, behaviorService)
 {
     this.panel = panel;
     if (serviceProvider != null)
     {
         this.menuService = serviceProvider.GetService(typeof(IMenuCommandService)) as IMenuCommandService;
         this.daUISvc = serviceProvider.GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:DesignerActionKeyboardBehavior.cs


示例14: Initialize

        protected override void Initialize()
        {
            base.Initialize();

            _menuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            _uiShell = GetService(typeof(SVsUIShell)) as IVsUIShell;

            AddMenuCommand(CommandIds.TotalCommander, HandleTotalCommanderMenuCommand, options => true);
        }
开发者ID:deus-amd,项目名称:VisualStudioExtensions,代码行数:9,代码来源:TotalCommanderLauncherPackage.cs


示例15: AddCommand

 /// <summary>
 /// Add a command handler and status query handler for a menu item
 /// </summary>
 private static OleMenuCommand AddCommand(
     IMenuCommandService menuCommandService,
     int commandId,
     EventHandler invokeHandler,
     EventHandler beforeQueryStatus)
 {
     var commandIdWithGroupId = new CommandID(Guids.RoslynGroupId, commandId);
     var command = new OleMenuCommand(invokeHandler, delegate { }, beforeQueryStatus, commandIdWithGroupId);
     menuCommandService.AddCommand(command);
     return command;
 }
开发者ID:jkotas,项目名称:roslyn,代码行数:14,代码来源:VisualStudioDiagnosticListTableCommandHandler.cs


示例16: ShowXPathWorkbenchCommand

 public ShowXPathWorkbenchCommand(Package package, IMenuCommandService commandService, int id, XmlRepository repository, ActiveDocument activeDocument)
 {
     _package = package;
     _repository = repository;
     _activeDocument = activeDocument;
     if(commandService == null)
     {
         throw new ArgumentNullException(nameof(commandService));
     }
     var menuCommandID = new CommandID(Guid.Parse(Symbols.PackageID), id);
     Command = new OleMenuCommand(ShowToolWindow, null, OnBeforeQueryStatus, menuCommandID, PackageResources.ShowXPathWorkbenchCommandText);
 }
开发者ID:uli-weltersbach,项目名称:XPathInformation,代码行数:12,代码来源:ShowXPathWorkbenchCommand.cs


示例17: Initialize

        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            if (Control is SettingsTree)
            {
                designerHost = GetService(typeof(IDesignerHost)) as IDesignerHost;
                menuService = GetService(typeof(IMenuCommandService)) as IMenuCommandService;
                selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
                settingsTree = Control as SettingsTree;
                settingsTree.TreeView.AfterSelect += OnNodeSelect;
            }


        }
开发者ID:ByteSempai,项目名称:Ubiquitous,代码行数:15,代码来源:SetupTreeDesigner.cs


示例18: AddCommandHandlers

        public override void AddCommandHandlers(IMenuCommandService menuCommandService)
        {
            //ModelExplorerCut = new CommandID(GuidSymbol, CutIDSymbol);
            ModelExplorerCopy = new CommandID(GuidSymbol, CopyIDSymbol);
            ModelExplorerPaste = new CommandID(GuidSymbol, PasteIDSymbol);

            //menuCommandService.AddCommand(
            //    new DynamicStatusMenuCommand(new EventHandler(OnStatusCut), new EventHandler(OnMenuCut), ModelExplorerCut));
            menuCommandService.AddCommand(
                new DynamicStatusMenuCommand(new EventHandler(OnStatusCopy), new EventHandler(OnMenuCopy), ModelExplorerCopy));
            menuCommandService.AddCommand(
                new DynamicStatusMenuCommand(new EventHandler(OnStatusPaste), new EventHandler(OnMenuPaste), ModelExplorerPaste));

            base.AddCommandHandlers(menuCommandService);
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:15,代码来源:ModelExplorer.cs


示例19: PackageCommandManager

        public PackageCommandManager(IServiceProvider serviceProvider)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            this.serviceProvider = serviceProvider;

            this.menuService = this.serviceProvider.GetService<IMenuCommandService>();
            if (this.menuService == null)
            {
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.MissingService, nameof(IMenuCommandService)), nameof(serviceProvider));
            }
        }
开发者ID:SonarSource-VisualStudio,项目名称:sonarlint-visualstudio,代码行数:15,代码来源:PackageCommandManager.cs


示例20: CommandSet

 public CommandSet(IServiceProvider serviceProvider)
 {
     this.serviceProvider = serviceProvider;
     this.menuCommandService = (IMenuCommandService) this.serviceProvider.GetService(typeof(IMenuCommandService));
     if (this.menuCommandService == null)
     {
         throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(IMenuCommandService).FullName }));
     }
     this.workflowView = serviceProvider.GetService(typeof(WorkflowView)) as WorkflowView;
     if (this.workflowView == null)
     {
         throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(WorkflowView).FullName }));
     }
     this.selectionService = (ISelectionService) this.serviceProvider.GetService(typeof(ISelectionService));
     if (this.selectionService == null)
     {
         throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(ISelectionService).FullName }));
     }
     this.commandSet = new List<System.Workflow.ComponentModel.Design.CommandSetItem>();
     this.commandSet.AddRange(new System.Workflow.ComponentModel.Design.CommandSetItem[] { 
         new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnMenuSaveWorkflowAsImage), WorkflowMenuCommands.SaveAsImage), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnMenuCopyToClipboard), WorkflowMenuCommands.CopyToClipboard), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusPrint), new EventHandler(this.OnMenuPrint), WorkflowMenuCommands.Print), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusPageSetup), new EventHandler(this.OnMenuPageSetup), WorkflowMenuCommands.PageSetup), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusDelete), new EventHandler(this.OnMenuDelete), StandardCommands.Delete), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusCopy), new EventHandler(this.OnMenuCopy), StandardCommands.Copy), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusCut), new EventHandler(this.OnMenuCut), StandardCommands.Cut), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusPaste), new EventHandler(this.OnMenuPaste), StandardCommands.Paste, true), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnMenuSelectAll), StandardCommands.SelectAll), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnMenuDesignerProperties), WorkflowMenuCommands.DesignerProperties), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnViewCode), new CommandID(StandardCommands.Cut.Guid, 0x14d)), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyCancel), MenuCommands.KeyCancel), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyCancel), MenuCommands.KeyReverseCancel), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveUp), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveDown), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveLeft), 
         new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyMove), MenuCommands.KeyMoveRight), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyMove), MenuCommands.KeySelectNext), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyMove), MenuCommands.KeySelectPrevious), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusExpandCollapse), new EventHandler(this.OnExpandCollapse), WorkflowMenuCommands.Expand), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusExpandCollapse), new EventHandler(this.OnExpandCollapse), WorkflowMenuCommands.Collapse), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusEnable), new EventHandler(this.OnEnable), WorkflowMenuCommands.Disable, true), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusEnable), new EventHandler(this.OnEnable), WorkflowMenuCommands.Enable, true), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnCreateTheme), WorkflowMenuCommands.CreateTheme), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnChangeTheme), WorkflowMenuCommands.ChangeTheme), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAnySelection), new EventHandler(this.OnKeyDefault), MenuCommands.KeyDefaultAction), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyPageDnUp), WorkflowMenuCommands.PageUp), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusAlways), new EventHandler(this.OnKeyPageDnUp), WorkflowMenuCommands.PageDown)
      });
     this.zoomCommands = new System.Workflow.ComponentModel.Design.CommandSetItem[] { new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.Zoom400Mode, DR.GetString("Zoom400Mode", new object[0])), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.Zoom300Mode, DR.GetString("Zoom300Mode", new object[0])), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.Zoom200Mode, DR.GetString("Zoom200Mode", new object[0])), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.Zoom150Mode, DR.GetString("Zoom150Mode", new object[0])), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.Zoom100Mode, DR.GetString("Zoom100Mode", new object[0])), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.Zoom75Mode, DR.GetString("Zoom75Mode", new object[0])), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.Zoom50Mode, DR.GetString("Zoom50Mode", new object[0])), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusZoom), new EventHandler(this.OnZoom), WorkflowMenuCommands.ShowAll, DR.GetString("ZoomShowAll", new object[0])) };
     this.commandSet.AddRange(this.zoomCommands);
     this.layoutCommands = new System.Workflow.ComponentModel.Design.CommandSetItem[] { new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusLayout), new EventHandler(this.OnPageLayout), WorkflowMenuCommands.DefaultPage), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusLayout), new EventHandler(this.OnPageLayout), WorkflowMenuCommands.PrintPreviewPage), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusLayout), new EventHandler(this.OnPageLayout), WorkflowMenuCommands.PrintPreview) };
     this.commandSet.AddRange(this.layoutCommands);
     this.navigationToolCommands = new System.Workflow.ComponentModel.Design.CommandSetItem[] { new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusMessageFilter), new EventHandler(this.OnMessageFilterChanged), NavigationToolCommandIds[0]), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusMessageFilter), new EventHandler(this.OnMessageFilterChanged), NavigationToolCommandIds[1]), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusMessageFilter), new EventHandler(this.OnMessageFilterChanged), NavigationToolCommandIds[2]), new System.Workflow.ComponentModel.Design.CommandSetItem(new EventHandler(this.OnStatusMessageFilter), new EventHandler(this.OnMessageFilterChanged), NavigationToolCommandIds[3]) };
     this.commandSet.AddRange(this.navigationToolCommands);
     for (int i = 0; i < this.commandSet.Count; i++)
     {
         if (this.menuCommandService.FindCommand(this.commandSet[i].CommandID) == null)
         {
             this.menuCommandService.AddCommand(this.commandSet[i]);
         }
     }
     IComponentChangeService service = this.serviceProvider.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
     if (service != null)
     {
         service.ComponentChanged += new ComponentChangedEventHandler(this.OnComponentChanged);
     }
     IDictionaryService service2 = this.serviceProvider.GetService(typeof(IDictionaryService)) as IDictionaryService;
     if (service2 != null)
     {
         service2.SetValue(typeof(CommandID), new CommandID(new Guid("5f1c3c8d-60f1-4b98-b85b-8679f97e8eac"), 0));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:47,代码来源:CommandSet.cs



注:本文中的IMenuCommandService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IMenuItem类代码示例发布时间:2022-05-24
下一篇:
C# IMenu类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap