当前位置: 首页>>代码示例>>C#>>正文


C# ICommandService.RegisterCommand方法代码示例

本文整理汇总了C#中ICommandService.RegisterCommand方法的典型用法代码示例。如果您正苦于以下问题:C# ICommandService.RegisterCommand方法的具体用法?C# ICommandService.RegisterCommand怎么用?C# ICommandService.RegisterCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICommandService的用法示例。


在下文中一共展示了ICommandService.RegisterCommand方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SledLuaVariableFilterService

        public SledLuaVariableFilterService(MainForm mainForm, ICommandService commandService)
        {
            m_mainForm = mainForm;

            // Global variable filter command
            commandService.RegisterCommand(
                Command.GlobalVariableFilter,
                SledLuaMenuShared.MenuTag,
                SledLuaMenuShared.CommandGroupTag,
                Localization.SledLuaFilterGlobalVars,
                Localization.SledLuaFilterGlobalVarsComment,
                Keys.None,
                null,
                CommandVisibility.Menu,
                this);

            // Local variable filter command
            commandService.RegisterCommand(
                Command.LocalVariableFilter,
                SledLuaMenuShared.MenuTag,
                SledLuaMenuShared.CommandGroupTag,
                Localization.SledLuaFilterLocalVars,
                Localization.SledLuaFilterLocalVarsComment,
                Keys.None,
                null,
                CommandVisibility.Menu,
                this);

            // Upvalue variable filter command
            commandService.RegisterCommand(
                Command.UpvalueVariableFilter,
                SledLuaMenuShared.MenuTag,
                SledLuaMenuShared.CommandGroupTag,
                Localization.SledLuaFilterUpvalueVars,
                Localization.SledLuaFilterUpvalueVarsComments,
                Keys.None,
                null,
                CommandVisibility.Menu,
                this);

            // Environment table variable filter command
            commandService.RegisterCommand(
                Command.EnvironmentVariableFilter,
                SledLuaMenuShared.MenuTag,
                SledLuaMenuShared.CommandGroupTag,
                Localization.SledLuaFilterEnvVarVars,
                Localization.SledLuaFilterEnvVarVarsComment,
                Keys.None,
                null,
                CommandVisibility.Menu,
                this);
        }
开发者ID:arsaccol,项目名称:SLED,代码行数:52,代码来源:SledLuaVariableFilterService.cs

示例2: SledLuaCompilerService

        public SledLuaCompilerService(
            MainForm mainForm,
            ICommandService commandService,
            ISettingsService settingsService)
        {
            m_mainForm = mainForm;

            commandService.RegisterCommand(
                Command.Compile,
                SledLuaMenuShared.MenuTag,
                SledLuaMenuShared.CommandGroupTag,
                Localization.SledLuaCompilerCompile,
                Localization.SledLuaCompilerCompileComment,
                Keys.None,
                SledLuaIcon.Compile,
                CommandVisibility.All,
                this);

            commandService.RegisterCommand(
                Command.Settings,
                SledLuaMenuShared.MenuTag,
                SledLuaMenuShared.CommandGroupTag,
                Localization.SledLuaCompilerSettings,
                Localization.SledLuaCompilerSettingsComment,
                Keys.None,
                null,
                CommandVisibility.Menu,
                this);


            // Save Lua compiler settings
            settingsService.RegisterSettings(
                this,
                new BoundPropertyDescriptor(
                    this,
                    () => LuaCompilerSettings,
                    Resources.Resource.LuaCompilerSettingsTitle,
                    Resources.Resource.LuaCompilerSettings,
                    Resources.Resource.LuaCompilerSettingsTitle));

            // Add some user settings to edit > preferences
            settingsService.RegisterUserSettings(
                SledLuaSettings.Category,
                new BoundPropertyDescriptor(
                    this,
                    () => Verbose,
                    Resources.Resource.Verbose,
                    Resources.Resource.LuaCompilerSettingsTitle,
                    Resources.Resource.Verbose));
        }
开发者ID:arsaccol,项目名称:SLED,代码行数:50,代码来源:SledLuaCompilerService.cs

示例3: RegisterCommand

 /// <summary>
 /// Registers a command for the command client</summary>
 /// <param name="commandService">Command service</param>
 protected void RegisterCommand(ICommandService commandService)
 {
     if (commandService != null)
     {
         commandService.RegisterCommand(
             Commands.EditTarget,
         Sce.Atf.Applications.StandardMenu.Edit,
         Sce.Atf.Applications.StandardCommandGroup.EditPreferences,
         "Target ...".Localize(),
         "Edit targets".Localize(),
         this);
     }
 }
开发者ID:Joxx0r,项目名称:ATF,代码行数:16,代码来源:TargetService.cs

示例4: SledLuaMemoryTraceService

 public SledLuaMemoryTraceService(ICommandService commandService)
 {
     commandService.RegisterCommand(
         Command.Toggle,
         SledLuaMenuShared.MenuTag,
         SledLuaMenuShared.CommandGroupTag,
         Localization.SledLuaToggleMemoryTracer,
         Localization.SledLuaToggleMemoryTracerComment,
         Keys.None,
         SledIcon.ProjectToggleMemoryTracer,
         CommandVisibility.All,
         this);
 }
开发者ID:arsaccol,项目名称:SLED,代码行数:13,代码来源:SledLuaMemoryTraceService.cs

示例5: SledTargetService

        public SledTargetService(
            MainForm mainForm,
            ICommandService commandService,
            ISettingsService settingsService)
        {
            m_mainForm = mainForm;

            // Create a new menu for target options
            var targetMenuInfo =
                commandService.RegisterMenu(
                    Menu.Target,
                    Localization.SledTargetMenuTitle,
                    Localization.SledTargetMenuTitleComment);

            commandService.RegisterCommand(
                Command.ShowDialog,
                Menu.Target,
                CommandGroup.Target,
                Localization.SledTargetMenuManageTargets,
                Localization.SledTargetMenuManageTargetsComment,
                Keys.Control | Keys.T,
                SledIcon.DebugManageTargets,
                CommandVisibility.All,
                this);

            m_remoteTargetComboBox = new ToolStripComboBox(Resources.Resource.RemoteTargets);
            m_remoteTargetComboBox.SelectedIndexChanged += RemoteTargetComboBoxSelectedIndexChanged;
            m_remoteTargetComboBox.IntegralHeight = true;
            m_remoteTargetComboBox.DropDownWidth += 100;
            if (m_remoteTargetComboBox.ComboBox != null)
            {
                var iWidth = m_remoteTargetComboBox.ComboBox.Width;
                m_remoteTargetComboBox.ComboBox.Width = iWidth + 100;
            }

            if (targetMenuInfo != null)
                targetMenuInfo.GetToolStrip().Items.Add(m_remoteTargetComboBox);

            settingsService.RegisterSettings(
                this,
                new BoundPropertyDescriptor(
                    this,
                    () => SledTargets,
                    "Sled Targets",
                    null,
                    null));
        }
开发者ID:arsaccol,项目名称:SLED,代码行数:47,代码来源:SledTargetService.cs

示例6: SledBreakpointService

        public SledBreakpointService(MainForm mainForm, ICommandService commandService)
        {
            m_mainForm = mainForm;

            var menuInfoContext =
                commandService.RegisterMenu(
                    Menu.Context,
                    "Breakpoint Context",
                    "Breakpoint Context Menu");

            commandService.RegisterCommand(
                Command.BreakpointAdd,
                Menu.Context,
                CommandGroup.Context,
                Localization.SledBreakpointMenuBreakpointAdd,
                Localization.SledBreakpointMenuBreakpointAddComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointRemove,
                Menu.Context,
                CommandGroup.Context,
                Localization.SledBreakpointMenuBreakpointRemove,
                Localization.SledBreakpointMenuBreakpointRemoveComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointEnable,
                Menu.Context,
                CommandGroup.Context,
                Localization.SledBreakpointMenuBreakpointEnable,
                Localization.SledBreakpointMenuBreakpointEnableComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointDisable,
                Menu.Context,
                CommandGroup.Context,
                Localization.SledBreakpointMenuBreakpointDisable,
                Localization.SledBreakpointMenuBreakpointDisableComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointCondition,
                Menu.Context,
                CommandGroup.Context,
                Localization.SledBreakpointMenuBreakpointCondition,
                Localization.SledBreakpointMenuBreakpointConditionComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointRemoveAll,
                Menu.Context,
                CommandGroup.Context,
                Localization.SledBreakpointMenuBreakpointRemoveAll,
                Localization.SledBreakpointMenuBreakpointRemoveAllComment,
                this);

            menuInfoContext.GetMenuItem().Visible = false;

            var menuInfoWindow =
                commandService.RegisterMenu(
                    Menu.Window,
                    "Breakpoint Window",
                    "Breakpoint Window Menu");

            commandService.RegisterCommand(
                Command.BreakpointWindowRemove,
                Menu.Window,
                CommandGroup.Window,
                Localization.BreakpointWindowRemove,
                Localization.BreakpointWindowRemoveComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointWindowEnable,
                Menu.Window,
                CommandGroup.Window,
                Localization.BreakpointWindowEnable,
                Localization.BreakpointWindowEnableComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointWindowDisable,
                Menu.Window,
                CommandGroup.Window,
                Localization.BreakpointWindowDisable,
                Localization.BreakpointWindowDisableComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointWindowCondition,
                Menu.Window,
                CommandGroup.Window,
                Localization.BreakpointWindowCondition,
                Localization.BreakpointWindowConditionComment,
                this);

            commandService.RegisterCommand(
                Command.BreakpointWindowConditionEnable,
//.........这里部分代码省略.........
开发者ID:arsaccol,项目名称:SLED,代码行数:101,代码来源:SledBreakpointService.cs

示例7: RegisteredSubProvider

 public RegisteredSubProvider(
     IContextMenuCommandProvider subProvider, 
     ICommandService commandService,
     ICommandClient client)
 {
     m_commands = subProvider.GetCommands(null, null);
     foreach (var c in m_commands)
     {
         var description = GetAnnotatedDescription(c).Localize();
         commandService.RegisterCommand(
             c,
             StandardMenu.File,
             CustomCommandGroups.NodeSpecific,
             description,
             description,
             Sce.Atf.Input.Keys.None,
             null,
             CommandVisibility.ContextMenu,
             client);
     }
 }
开发者ID:ldh9451,项目名称:XLE,代码行数:21,代码来源:GameProjectLister.cs

示例8: SledSourceControlService

        public SledSourceControlService(
            MainForm mainForm,
            ICommandService commandService,
            ISettingsService settingsService,
            IControlHostService controlHostService,
            ISledProjectService projectService,
            ISledDocumentService documentService,
            IContextRegistry contextRegistry)
        {
            m_mainForm = mainForm;
            m_projectService = projectService;
            m_documentService = documentService;
            m_contextRegistry = contextRegistry;

            // Associate values for commands the 'public' can use
            m_dictPublicCommands.Add(SledSourceControlCommand.Add, Command.Add);
            m_dictPublicCommands.Add(SledSourceControlCommand.CheckIn, Command.CheckIn);
            m_dictPublicCommands.Add(SledSourceControlCommand.CheckOut, Command.CheckOut);
            m_dictPublicCommands.Add(SledSourceControlCommand.Refresh, Command.Refresh);
            m_dictPublicCommands.Add(SledSourceControlCommand.Revert, Command.Revert);
            m_dictPublicCommands.Add(SledSourceControlCommand.History, Command.History);

            commandService.RegisterMenu(
                Menu.SourceControl,
                SourceControlText,
                "Source Control Menu");

            try
            {
                m_go = ResourceUtil.GetImageList16().Images[SledIcon.Go];
            }
            catch (Exception ex)
            {
                SledOutDevice.OutLine(
                    SledMessageType.Error,
                    "Exception acquiring \"{0}\" image: {1}",
                    SledIcon.Go, ex.Message);

                m_go = null;
            }

            try
            {
                m_stop = ResourceUtil.GetImageList16().Images[SledIcon.Stop];
            }
            catch (Exception ex)
            {
                SledOutDevice.OutLine(
                    SledMessageType.Error,
                    "Exception acquiring \"{0}\" image: {1}",
                    SledIcon.Stop, ex.Message);

                m_stop = null;
            }

            m_status =
                commandService.RegisterCommand(
                    Command.Enabled,
                    Menu.SourceControl,
                    Group.SourceControl,
                    "No source control plugin found!",
                    "Enable or disable using the source control plugin",
                    Keys.None,
                    SledIcon.Stop,
                    CommandVisibility.All,
                    this);

            commandService.RegisterCommand(
                Command.Add,
                Menu.SourceControl,
                Group.SourceControl,
                SourceControlCommandPrefix + "Add",
                "Add to source control",
                Keys.None,
                Atf.Resources.DocumentAddImage,
                CommandVisibility.All,
                this);

            commandService.RegisterCommand(
                Command.Revert,
                Menu.SourceControl,
                Group.SourceControl,
                SourceControlCommandPrefix + "Revert",
                "Revert add or check out from source control",
                Keys.None,
                Atf.Resources.DocumentRevertImage,
                CommandVisibility.All,
                this);

            commandService.RegisterCommand(
                Command.CheckIn,
                Menu.SourceControl,
                Group.SourceControl,
                SourceControlCommandPrefix + "Check In",
                "Check in to source control",
                Keys.None,
                Atf.Resources.DocumentLockImage,
                CommandVisibility.All,
                this);

//.........这里部分代码省略.........
开发者ID:arsaccol,项目名称:SLED,代码行数:101,代码来源:SledSourceControlService.cs

示例9: SledTtyService

        public SledTtyService(
            MainForm mainForm,
            ICommandService commandService,
            ISettingsService settingsService,
            IControlHostService controlHostService)
        {
            m_mainForm = mainForm;
            m_commandService = commandService;
            m_lastFlush = DateTime.Now;

            // Create GUI
            m_control =
                new SledTtyGui
                    {
                        Name = "TTY",
                        ColumnNames = new[] {"Time", "Data"}
                    };
            m_control.SendClicked += ControlSendClicked;

            // Register menu
            commandService.RegisterMenu(
                Menu.Tty,
                Localization.SledTTY,
                Localization.SledTTYOptions);

            // Register command to bring up TTY filters
            commandService.RegisterCommand(
                Command.Filter,
                Menu.Tty,
                CommandGroup.Tty,
                Localization.SledTTYFilterTTYOutput,
                Localization.SledTTYFilterTTYOutputComment,
                Keys.None,
                null,
                CommandVisibility.Menu,
                this);

            // Register clear TTY window command
            commandService.RegisterCommand(
                Command.Clear,
                Menu.Tty,
                CommandGroup.Tty,
                Localization.SledTTYClearTTYWindow,
                Localization.SledTTYClearTTYWindowComment,
                Keys.None,
                null,
                CommandVisibility.Menu,
                this);

            // Save the TTY filter list
            settingsService.RegisterSettings(
                this,
                new BoundPropertyDescriptor(
                    this,
                    () => TtyFilters,
                    Resources.Resource.TTYFilterListTitle,
                    Resources.Resource.TTY,
                    Resources.Resource.TTYFilterListComment));

            // Save GUI settings
            settingsService.RegisterSettings(
                this,
                new BoundPropertyDescriptor(
                    this,
                    () => GuiSettings,
                    "Tty GUI Settings",
                    Resources.Resource.TTY,
                    "Tty GUI settings"));
        }
开发者ID:arsaccol,项目名称:SLED,代码行数:69,代码来源:SledTTYService.cs


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