Ejemplo n.º 1
0
 public void AttachChild(Process child)
 {
     if (Child == null)
     {
         Child = child;
     }
     else
     {
         //allow chaining from the top
         Child.AttachChild(child);
     }
 }
Ejemplo n.º 2
0
        private void HandleDeadProcess(Process process, ref ProcessCounter counter)
        {
            var successCount = 0;
            var failCount = 0;

            // run the appropriate exit function
            switch (process.State)
            {
                case ProcessState.Succeeded:
                    process.OnSuccess();
                    var child = process.RemoveChild();
                    if (child != null)
                        AttachProcess(child);
                    else
                        ++successCount; // only counts if the whole chain completed
                    break;

                case ProcessState.Failed:
                    process.OnFail();
                    ++failCount;
                    break;

                case ProcessState.Aborted:
                    process.OnAbort();
                    ++failCount;
                    break;

            }

            // remove the process and destroy it
            process.Destroy();
            ProcessList.Remove(process);

            counter.Fail += failCount;
            counter.Success += successCount;
        }
Ejemplo n.º 3
0
 public void AttachProcess(Process process)
 {
     ProcessList.Add(process);
 }