예제 #1
0
        protected override void ExecuteTask()
        {
            this.Process = this.StartProcess();

            if (this.RedirectOutput)
            {
                Thread outputThread = null;
                Thread errorThread  = null;
                outputThread = new Thread(new ThreadStart(StreamReaderThread_Output));
                errorThread  = new Thread(new ThreadStart(StreamReaderThread_Error));

                outputThread.IsBackground = true;
                errorThread.IsBackground  = true;

                _stdOut   = this.Process.StandardOutput;
                _stdError = this.Process.StandardError;

                outputThread.Start();
                errorThread.Start();
            }

            if (this.TaskName != string.Empty && this.WaitForExit == false)
            {
                Log(Level.Warning, "You set the attribute taskname to {0} and waitforexit to false.  You will not be able to call the waitforexit task with the task name {0} with an error.  If you wanted to wait for this to exit please set waitforexit to true.", this.TaskName);
            }
            if (this.TaskName != string.Empty && this.WaitForExit)
            {
                AsyncExecList.Add(this.TaskName, this);
            }
            if (this.TaskName == string.Empty && this.WaitForExit)
            {
                this.Wait();
            }
        }
예제 #2
0
        protected override void ExecuteTask()
        {
            AsyncExec Worker;

            foreach (string TaskName in this.TaskNames.StringItems.Values)
            {
                Worker = AsyncExecList.GetTask(TaskName);
                Worker.Wait();
            }
        }
예제 #3
0
 protected override void ExecuteTask()
 {
     this.Process = this.StartProcess();
     if (this.TaskName != string.Empty && this.WaitForExit == false)
     {
         Log(Level.Warning, "You set the attribute taskname to {0} and waitforexit to false.  You will not be able to call the waitforexit task with the task name {0} with an error.  If you wanted to wait for this to exit please set waitforexit to true.", this.TaskName);
     }
     if (this.TaskName != string.Empty && this.WaitForExit)
     {
         AsyncExecList.Add(this.TaskName, this);
     }
     if (this.TaskName == string.Empty && this.WaitForExit)
     {
         this.Wait();
     }
 }