Exemplo n.º 1
0
        private void GitPluginUISetupCommandBar()
        {
            // Try to delete the commandbar if it exists from a previous execution,
            // because the /resetaddin command-line switch of VS 2005 (or higher) add-in
            // projects only resets commands and buttons, not commandbars
            _gitPlugin.DeleteGitExtCommandBar();

            try
            {
                CommandBar commandBar = _gitPlugin.AddGitExtCommandBar(MsoBarPosition.msoBarTop);

                _gitPlugin.AddToolbarCommandWithText(commandBar, "Commit", "Commit", "Commit changes", 7, 1);
                _gitPlugin.AddToolbarCommand(commandBar, "Browse", "Browse", "Browse repository", 12, 2);
                _gitPlugin.AddToolbarCommand(commandBar, "Pull", "Pull", "Pull changes from remote repository", 9, 3);
                _gitPlugin.AddToolbarCommand(commandBar, "Push", "Push", "Push changes to remote repository", 8, 4);
                _gitPlugin.AddToolbarCommand(commandBar, "Stash", "Stash", "Stash changes", 3, 5);
                _gitPlugin.AddToolbarCommand(commandBar, "Settings", "Settings", "Settings", 2, 6);
            }
            catch (Exception ex)
            {
                _gitPlugin.OutputPane.OutputString("Error creating toolbar: " + ex);
            }
        }