示例#1
0
 private void AboutToolStripMenuItemClick(object sender, EventArgs e)
 {
     using (var frm = new AboutBox()) frm.ShowDialog(this);
 }
 // Please update FormCommandlineHelp if you add or change commands
 private void RunCommandBasedOnArgument(string[] args, Dictionary<string, string> arguments)
 {
     switch (args[1])
     {
         case "about":
             var frm = new AboutBox();
             frm.StartPosition = FormStartPosition.CenterScreen;
             Application.Run(frm);
             return;
         case "add":
         case "addfiles":
             StartAddFilesDialog(args.Length == 3 ? args[2] : ".");
             return;
         case "apply":       // [filename]
         case "applypatch":
             StartApplyPatchDialog(args.Length == 3 ? args[2] : "");
             return;
         case "blame":       // filename
             RunBlameCommand(args);
             return;
         case "branch":
             StartCreateBranchDialog();
             return;
         case "browse":      // [path] [-filter]
             RunBrowseCommand(args);
             return;
         case "checkout":
         case "checkoutbranch":
             StartCheckoutBranchDialog();
             return;
         case "checkoutrevision":
             StartCheckoutRevisionDialog();
             return;
         case "cherry":
             StartCherryPickDialog();
             return;
         case "cleanup":
             StartCleanupRepositoryDialog();
             return;
         case "clone":       // [path]
             RunCloneCommand(args);
             return;
         case "commit":      // [--quiet]
             Commit(arguments);
             return;
         case "difftool":      // filename
             Module.OpenWithDifftool(args[2]);
             return;
         case "filehistory": // filename
             RunFileHistoryCommand(args);
             return;
         case "fileeditor":  // filename
             RunFileEditorCommand(args);
             return;
         case "formatpatch":
             StartFormatPatchDialog();
             return;
         case "gitbash":
             Module.RunBash();
             return;
         case "gitignore":
             StartEditGitIgnoreDialog();
             return;
         case "init":        // [path]
             RunInitCommand(args);
             return;
         case "merge":       // [--branch name]
             RunMergeCommand(arguments);
             return;
         case "mergeconflicts": // [--quiet]
         case "mergetool":
             RunMergeToolOrConflictCommand(arguments);
             return;
         case "openrepo":    // [path]
             RunOpenRepoCommand(args);
             return;
         case "pull":        //  [--rebase] [--merge] [--fetch] [--quiet] [--remotebranch name]
             Pull(arguments);
             return;
         case "push":        // [--quiet]
             Push(arguments);
             return;
         case "rebase":      // [--branch name]
             RunRebaseCommand(arguments);
             return;
         case "remotes":
             StartRemotesDialog();
             return;
         case "reset":
             StartResetChangesDialog();
             return;
         case "revert":      // filename
             StartRevertDialog(args[2]);
             return;
         case "searchfile":
             RunSearchFileCommand();
             return;
         case "settings":
             StartSettingsDialog();
             return;
         case "stash":
             StartStashDialog();
             return;
         case "synchronize": // [--rebase] [--merge] [--fetch] [--quiet]
             RunSynchronizeCommand(arguments);
             return;
         case "tag":
             StartCreateTagDialog();
             return;
         case "viewdiff":
             StartCompareRevisionsDialog();
             return;
         case "viewpatch":   // [filename]
             StartViewPatchDialog(args.Length == 3 ? args[2] : "");
             return;
         default:
             if (args[1].StartsWith("git://") || args[1].StartsWith("http://") || args[1].StartsWith("https://"))
             {
                 StartCloneDialog(null, args[1], true, null);
                 return;
             }
             if (args[1].StartsWith("github-windows://openRepo/"))
             {
                 StartCloneDialog(null, args[1].Replace("github-windows://openRepo/", ""), true, null);
                 return;
             }
             break;
     }
     var frmCmdLine = new FormCommandlineHelp();
     frmCmdLine.StartPosition = FormStartPosition.CenterScreen;
     Application.Run(frmCmdLine);
 }
示例#3
0
 private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AboutBox a = new AboutBox();
     a.ShowDialog();
 }