Пример #1
0
 public void ProcessLine(string line)
 {
     currentActivity.Name = line;
     currentActivity.Stop();
     lastActivity    = currentActivity;
     currentActivity = RunningActivity.After(currentActivity, "");
     Save();
 }
Пример #2
0
 public TimeManager(ITimeLogsManager timeLogsManager)
 {
     currentActivity   = new RunningActivity(FIRST_ACTIVITY);
     midnightCorrector = new MidnightSwitcher();
     if (timeLogsManager != null)
     {
         TimeLogsManager = timeLogsManager;
         timeLogsManager.ActivateTimeLog(currentActivity.Start.Date);
     }
 }
Пример #3
0
 /// <summary>
 /// Check current activity for comma and split if necessary
 /// <returns>list of additional activities created by split by comma or empty array</returns>
 /// </summary>
 private List <IActivity> CheckForComma()
 {
     RunningActivity[] additionalActivities = (splitByComma) ?
                                              currentActivity.SplitByComma() :
                                              new RunningActivity[] { currentActivity };
     foreach (RunningActivity additionalActivity in additionalActivities)
     {
         CheckForMidnight();
         currentActivity = additionalActivity;
         AddToTimeLog();
     }
     return(new List <IActivity>(additionalActivities));
 }
Пример #4
0
 public Interpreter()
 {
     Load();
     currentActivity = new RunningActivity("");
 }
Пример #5
0
 public Interpreter(ITimeSystem timeSystem)
 {
     Load();
     this.timeSystem = timeSystem;
     currentActivity = new RunningActivity("", timeSystem);
 }
Пример #6
0
 private void StartNext(string nextActivityName)
 {
     previousActivity = currentActivity;
     currentActivity  = RunningActivity.After(previousActivity, nextActivityName);
 }