public TimeBlockListItemViewModel(TimeBlock timeBlock)
 {
     this.timeBlock = timeBlock;
 }
 public void Update(TimeBlock timeBlock)
 {
     this.timeBlock = timeBlock;
     RaisePropertyChanged(() => Date);
     RaisePropertyChanged(() => Time);
 }
Beispiel #3
0
 void HandleTaskStarted(object sender, EntityIdEventArgs e)
 {
     activeTimeBlock = timeBlocksModel.Add(e.Id, Now);
 }
Beispiel #4
0
 void HandleTaskStopped(object sender, EntityIdEventArgs e)
 {
     activeTimeBlock.End = Now;
     timeBlocksModel.Update(activeTimeBlock);
     activeTimeBlock = null;
 }
Beispiel #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;
 }
 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);
 }
Beispiel #9
0
 bool BlockIsToday(TimeBlock timeBlock)
 {
     return timeBlock.Start.Date == DateTime.Today;
 }