Пример #1
0
        public static void StartTimerById(string id)
        {
            if (_timeManager.RunningTimeEntry != null)
            {
                SavePreviousTask();
            }

            TimeEntry timeEntry = new TimeEntry() { StartTime = DateTime.Now, UniqueId = id };
            _timeManager.RunningTimeEntry = timeEntry;

            TaskObject taskToStart = AppDataSource.GetTaskObjectById(id);
            taskToStart.IsRunning = true;
        }
Пример #2
0
        public void AddToCollection(TimeEntry timeEntry)
        {
            foreach (var item in _uniqueIdCollection)
            {
                if (item.TaskObject.UniqueId == timeEntry.UniqueId)
                {
                    item.TimeEntries.Add(timeEntry);
                    return;
                }
            }

            _uniqueIdCollection.Add(new TimeEntryCollection(timeEntry.UniqueId, timeEntry));
        }
Пример #3
0
 public TimeEntryCollection(string id, TimeEntry timeEntry)
 {
     TaskObject = AppDataSource.GetTaskObjectById(id);
     TimeEntries.Add(timeEntry);
 }