コード例 #1
0
 public void Finish(DateTime finishTime)
 {
     if (Complete)
     {
         throw new NotSupportedException(String.Format("Cannot finish already completed activity {0}", Name));
     }
     complete = true;
     currentExecutionMap.Finish(name, finishTime);
     maps.Add(currentExecutionMap);
     if (maps.Count > maxMapsHistory)
     {
         maps.RemoveAt(0);
     }
     currentExecutionMap = null;
 }
コード例 #2
0
        public void Restart(DateTime restartTime)
        {
            if (!Complete)
            {
                throw new NotSupportedException(String.Format("Cannot restart an activity {0} which is not complete yet.", Name));
            }
            if (currentExecutionMap != null)
            {
                throw new NotSupportedException("Current execution map must be null when restarting an activity.");
            }
            ExecutionMap newCurrent = new ExecutionMap();

            newCurrent.Start(name, String.Empty, restartTime);
            currentExecutionMap = newCurrent;
            complete            = false;
        }
コード例 #3
0
 public Activity(string name, DateTime startTime)
 {
     this.name           = name;
     currentExecutionMap = new ExecutionMap();
     currentExecutionMap.Start(name, String.Empty, startTime);
 }