AsyncRun() 공개 메소드

public AsyncRun ( PStdoutDelegate pstdout, PStderrDelegate pstderr, PCompleteDelegate pcomplete ) : void
pstdout PStdoutDelegate
pstderr PStderrDelegate
pcomplete PCompleteDelegate
리턴 void
예제 #1
0
파일: ClassGit.cs 프로젝트: pausan/GitForce
        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());
        }
예제 #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();
        }
예제 #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);
 }