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


C# Plugin.AddPopupCommand方法代码示例

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


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

示例1: OnConnection


//.........这里部分代码省略.........
                    {
                        toolsControl = menuBarCommandBar.Controls[GetToolsMenuName()];
                        toolsPopup = (CommandBarPopup) toolsControl;
                    }
                }

                try
                {
                    // add the toolbar and menu commands
                    var commandBar = _gitPlugin.AddCommandBar("GitExtensions", MsoBarPosition.msoBarTop);

                    _gitPlugin.AddToolbarCommandWithText(
                        commandBar, "GitExtensionsCommit", "Commit", "Commit changes", 7,1);

                    _gitPlugin.AddToolbarCommand(commandBar,
                        "GitExtensionsBrowse", "Browse", "Browse repository", 12, 2);
                    _gitPlugin.AddToolbarCommand(commandBar, "GitExtensionsPull", "Pull",
                                                "Pull changes from remote repository", 9, 3);
                    _gitPlugin.AddToolbarCommand(commandBar, "GitExtensionsPush", "Push",
                                                "Push changes to remote repository", 8, 4);
                    _gitPlugin.AddToolbarCommand(commandBar,
                        "GitExtensionsStash", "Stash", "Stash changes", 3, 5);
                    _gitPlugin.AddToolbarCommand(commandBar,
                        "GitExtensionsSettings", "Settings", "Settings", 2, 6);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }

                try
                {
                    var n = 1;
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsApplyPatch", "Apply patch", "Apply patch", 0,
                                              n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsBrowse", "Browse", "Browse repository", 12, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsSwitchBranch", "Checkout branch",
                                              "Switch to branch", 10, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsCherryPick", "Cherry pick", "Cherry pick commit",
                                              11, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsCommit", "Commit", "Commit changes", 7, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsCreateBranch", "Create branch",
                                              "Create new branch", 10, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsClone", "Clone repository", "Clone existing Git",
                                              14, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsGitIgnore", "Edit .gitignore",
                                              "Edit .gitignore file", 0, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsFormatPatch", "Format patch", "Format patch", 0,
                                              n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsBash", "Git bash", "Start git bash", 0, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsInitRepository", "Initialize new repository",
                                              "Initialize new Git repository", 13, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsRemotes", "Manage remotes",
                                              "Manage remote repositories", 0, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsMerge", "Merge", "merge", 0, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsPull", "Pull",
                                              "Pull changes from remote repository", 9, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsPush", "Push",
                                              "Push changes to remote repository", 8, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsRebase", "Rebase", "Rebase", 0, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsStash", "Stash", "Stash changes", 3, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsSettings", "Settings", "Settings", 2, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsSolveMergeConflicts", "Solve mergeconflicts",
                                              "Solve mergeconflicts", 0, n++);
                    _gitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsDiff", "View changes",
                                              "View commit change history", 0, n++);
开发者ID:DavidBasarab,项目名称:gitextensions,代码行数:67,代码来源:Connect.cs

示例2: OnConnection


//.........这里部分代码省略.........
                    GitPlugin.RegisterCommand("GitExtensionsPull", new ToolbarCommand<Pull>());
                    GitPlugin.RegisterCommand("GitExtensionsPush", new ToolbarCommand<Push>());
                    GitPlugin.RegisterCommand("GitExtensionsRebase", new ToolbarCommand<Rebase>());
                    GitPlugin.RegisterCommand("GitExtensionsRevert", new ToolbarCommand<Revert>());
                    GitPlugin.RegisterCommand("GitExtensionsMerge", new ToolbarCommand<Merge>());
                    GitPlugin.RegisterCommand("GitExtensionsCherryPick", new ToolbarCommand<Cherry>());
                    GitPlugin.RegisterCommand("GitExtensionsStash", new ToolbarCommand<Stash>());
                    GitPlugin.RegisterCommand("GitExtensionsSettings", new ToolbarCommand<Settings>());
                    GitPlugin.RegisterCommand("GitExtensionsSolveMergeConflicts", new ToolbarCommand<SolveMergeConflicts>());
                    GitPlugin.RegisterCommand("GitExtensionsApplyPatch", new ToolbarCommand<ApplyPatch>());
                    GitPlugin.RegisterCommand("GitExtensionsAbout", new ToolbarCommand<About>());
                    GitPlugin.RegisterCommand("GitExtensionsBash", new ToolbarCommand<Bash>());
                    GitPlugin.RegisterCommand("GitExtensionsGitIgnore", new ToolbarCommand<GitIgnore>());
                    GitPlugin.RegisterCommand("GitExtensionsRemotes", new ToolbarCommand<Remotes>());
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }

                try
                {
                    // add the toolbar and menu commands
                    CommandBar commandBar = GitPlugin.AddCommandBar("GitExtensions", MsoBarPosition.msoBarTop);
                    GitPlugin.AddToolbarCommandWithText(commandBar, "GitExtensionsCommit", "Commit", "Commit changes", 7, 1);
                    GitPlugin.AddToolbarCommand(commandBar, "GitExtensionsBrowse", "Browse", "Browse repository", 12, 2);
                    GitPlugin.AddToolbarCommand(commandBar, "GitExtensionsPull", "Pull", "Pull changes from remote repository", 9, 3);
                    GitPlugin.AddToolbarCommand(commandBar, "GitExtensionsPush", "Push", "Push changes to remote repository", 8, 4);
                    GitPlugin.AddToolbarCommand(commandBar, "GitExtensionsStash", "Stash", "Stash changes", 3, 5);
                    GitPlugin.AddToolbarCommand(commandBar, "GitExtensionsSettings", "Settings", "Settings", 2, 6);
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }

                try
                {
                    int n = 1;
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsApplyPatch", "Apply patch", "Apply patch", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsBrowse", "Browse", "Browse repository", 12, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsSwitchBranch", "Checkout branch", "Switch to branch", 10, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsCherryPick", "Cherry pick", "Cherry pick commit", 11, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsCommit", "Commit", "Commit changes", 7, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsCreateBranch", "Create branch", "Create new branch", 10, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsClone", "Clone repository", "Clone existing Git", 14, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsGitIgnore", "Edit .gitignore", "Edit .gitignore file", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsFormatPatch", "Format patch", "Format patch", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsBash", "Git bash", "Start git bash", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsInitRepository", "Initialize new repository", "Initialize new Git repository", 13, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsRemotes", "Manage remotes", "Manage remote repositories", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsMerge", "Merge", "merge", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsPull", "Pull changes", "Pull changes from remote repository", 9, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsPush", "Push changes", "Push changes to remote repository", 8, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsRebase", "Rebase", "Rebase", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsStash", "Stash changes", "Stash changes", 3, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsSettings", "Settings", "Settings", 2, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsSolveMergeConflicts", "Solve mergeconflicts", "Solve mergeconflicts", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsDiff", "View changes", "View commit change history", 0, n++);
                    GitPlugin.AddPopupCommand(toolsPopup, "GitExtensionsAbout", "About Git Extensions", "About Git Extensions", 0, n++);
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }

                try
                {
                    GitPlugin.AddMenuCommand("Item", "GitExtensionsFileHistory", "File history", "Show file history", 6, 4);
                    GitPlugin.AddMenuCommand("Item", "GitExtensionsRevert", "Undo file changes", "Undo changes made to this file", 4, 5);
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }
                try
                {
                    GitPlugin.AddMenuCommand("Easy MDI Document Window", "GitExtensionsFileHistory", "File history", "Show file history", 6, 4);
                    GitPlugin.AddMenuCommand("Easy MDI Document Window", "GitExtensionsRevert", "Undo file changes", "Undo changes made to this file", 4, 5);
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }

                try
                {
                    GitPlugin.AddMenuCommand("Code Window", "GitExtensionsFileHistory", "File history", "Show file history", 6, 10);
                    GitPlugin.AddMenuCommand("Code Window", "GitExtensionsRevert", "Undo file changes", "Undo changes made to this file", 4, 11);
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }
            }
            catch (Exception ex)
            {
                string s = ex.Message;
            }
        }
开发者ID:jorn,项目名称:gitextensions,代码行数:101,代码来源:Connect.cs


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