public TimeBlockListItemViewModel(TimeBlock timeBlock)
 {
     this.timeBlock = timeBlock;
 }
 public void Update(TimeBlock timeBlock)
 {
     this.timeBlock = timeBlock;
     RaisePropertyChanged(() => Date);
     RaisePropertyChanged(() => Time);
 }
Example #3
0
 void HandleTaskStarted(object sender, EntityIdEventArgs e)
 {
     activeTimeBlock = timeBlocksModel.Add(e.Id, Now);
 }
Example #4
0
 void HandleTaskStopped(object sender, EntityIdEventArgs e)
 {
     activeTimeBlock.End = Now;
     timeBlocksModel.Update(activeTimeBlock);
     activeTimeBlock = null;
 }
Example #5
0
 protected double GetDurationForBlock(TimeBlock timeBlock)
 {
     DateTime end = (timeBlock.End != DateTime.MaxValue) ? timeBlock.End : DateTime.UtcNow;
     TimeSpan duration = end - timeBlock.Start;
     return duration.TotalSeconds;
 }
Example #6
0
 public EditTimeBlockViewModel(Guid timeBlockId, ITimeBlocksModel timeBlocksModel)
 {
     this.timeBlocksModel = timeBlocksModel;
     timeBlock = timeBlocksModel.Get(timeBlockId);
     UpdateTimeBlockCommand = new RelayCommand(UpdateTimeBlockExecute, CanExecuteUpdateTimeBlock);
 }
 public void Update(TimeBlock timeBlock)
 {
     throw new NotImplementedException();
 }
 ITimeBlockListItemViewModel CreateTimeBlockListItemViewModel(TimeBlock t)
 {
     return timeBlockListItemViewModelFactory.Create(t);
 }
Example #9
0
 bool BlockIsToday(TimeBlock timeBlock)
 {
     return timeBlock.Start.Date == DateTime.Today;
 }