AsyncRun() public method

public AsyncRun ( PStdoutDelegate pstdout, PStderrDelegate pstderr, PCompleteDelegate pcomplete ) : void
pstdout PStdoutDelegate
pstderr PStderrDelegate
pcomplete PCompleteDelegate
return void
Beispiel #1
0
        public static ExecResult Run(string gitcmd, bool async)
        {
            // Pick up git commands that take long time to execute and run them
            // using a threaded execution
            if (gitcmd.StartsWith("clone --progress") ||
                gitcmd.StartsWith("fetch") ||
                gitcmd.StartsWith("pull ") ||
                gitcmd.StartsWith("push "))
            {
                FormGitRun formGitRun = new FormGitRun(Properties.Settings.Default.GitPath, gitcmd);
                formGitRun.ShowDialog();
                return(formGitRun.GetResult());
            }

            if (!async)
            {
                return(Exec.Run(Properties.Settings.Default.GitPath, gitcmd));
            }

            var job = new Exec(Properties.Settings.Default.GitPath, gitcmd);

            job.AsyncRun(s => App.PrintStatusMessage(s, MessageType.Output),
                         s => App.PrintStatusMessage(s, MessageType.Error),
                         null);
            return(new ExecResult());
        }
Beispiel #2
0
        public static ExecResult Run(string gitcmd, bool async)
        {
            // Pick up git commands that take long time to execute and run them
            // using a threaded execution
            if (gitcmd.StartsWith("clone --progress") ||
                gitcmd.StartsWith("fetch") ||
                gitcmd.StartsWith("pull ") ||
                gitcmd.StartsWith("push "))
            {
                FormGitRun formGitRun = new FormGitRun(Properties.Settings.Default.GitPath, gitcmd);
                formGitRun.ShowDialog();
                return formGitRun.GetResult();
            }

            if (!async)
            {
                return Exec.Run(Properties.Settings.Default.GitPath, gitcmd);
            }

            var job = new Exec(Properties.Settings.Default.GitPath, gitcmd);
            job.AsyncRun(s => App.PrintStatusMessage(s, MessageType.Output),
                         s => App.PrintStatusMessage(s, MessageType.Error),
                         null);
            return new ExecResult();
        }
Beispiel #3
0
 /// <summary>
 /// Start running the preset command at the time form is first shown
 /// </summary>
 private void FormGitRunShown(object sender, EventArgs e)
 {
     UseWaitCursor = true;
     // Start the job using our own output handlers
     job.AsyncRun(PStdout, PStderr, PComplete);
 }