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