Esempio n. 1
0
File: Task.cs Progetto: vadgama/MLW
        public void SyncProgress(TaskProgessModel taskProgressModel)
        {
            switch (taskProgressModel.ProgressEvent)
            {
            case ProgessEvents.OnStart:
                OnStart(taskProgressModel);
                break;

            case ProgessEvents.OnUpdateStandardOutput:
                OnUpdateStandardOutput(taskProgressModel);
                break;

            case ProgessEvents.OnUpdateStandardError:
                OnUpdateStandardError(taskProgressModel);
                break;

            case ProgessEvents.OnError:
                OnError(taskProgressModel);
                break;

            case ProgessEvents.OnExit:
                OnExit(taskProgressModel);
                break;
            }
        }
Esempio n. 2
0
File: Task.cs Progetto: vadgama/MLW
 private void OnExit(TaskProgessModel taskProgress)
 {
     try
     {
         this.ExitCode = taskProgress.ExitCode;
         this.RunTime  = DateTime.Now - this.StartTime;
         this.isAlive  = false;
         LogTask(string.Format("Exit Code : {0}, RunTime : {1}", this.ExitCode, this.RunTime));
         LogTask("End Task", true);
     }
     catch (Exception ex) {}
 }
Esempio n. 3
0
File: Task.cs Progetto: vadgama/MLW
 private void OnUpdateStandardError(TaskProgessModel taskProgress)
 {
     try
     {
         lock (result)
         {
             result.UpdateError(taskProgress.StandardErrorPart);
             LogTask(taskProgress.StandardErrorPart);
         }
     }
     catch (Exception ex) {}
 }
Esempio n. 4
0
File: Task.cs Progetto: vadgama/MLW
 private void OnError(TaskProgessModel taskProgress)
 {
     try
     {
         lock (result)
         {
             result.UpdateLog(taskProgress.StandardErrorPart);
             LogTask(taskProgress.StandardErrorPart);
         }
         this.ExitCode = taskProgress.ExitCode;
         this.isAlive  = taskProgress.IsAlive;
     }
     catch (Exception ex) {}
 }
Esempio n. 5
0
File: Task.cs Progetto: vadgama/MLW
 private void OnStart(TaskProgessModel taskProgress)
 {
     result         = new Output(taskProgress.ProcessId);
     this.StartTime = taskProgress.StartTime;
     LogTask(string.Format("Start Task with Process Id : {0}, Time : {1}", taskProgress.ProcessId, this.StartTime));
 }