public void ProcessLine(string line) { currentActivity.Name = line; currentActivity.Stop(); lastActivity = currentActivity; currentActivity = RunningActivity.After(currentActivity, ""); Save(); }
public TimeManager(ITimeLogsManager timeLogsManager) { currentActivity = new RunningActivity(FIRST_ACTIVITY); midnightCorrector = new MidnightSwitcher(); if (timeLogsManager != null) { TimeLogsManager = timeLogsManager; timeLogsManager.ActivateTimeLog(currentActivity.Start.Date); } }
/// <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)); }
public Interpreter() { Load(); currentActivity = new RunningActivity(""); }
public Interpreter(ITimeSystem timeSystem) { Load(); this.timeSystem = timeSystem; currentActivity = new RunningActivity("", timeSystem); }
private void StartNext(string nextActivityName) { previousActivity = currentActivity; currentActivity = RunningActivity.After(previousActivity, nextActivityName); }