Exemplo n.º 1
0
        public void UpdateHoursRemaining(int hours)
        {
            if (hours < 0)
            {
                return;
            }
            int currentHoursRemaining = HoursRemaining;

            HoursRemaining = hours;
            if (HoursRemaining == 0)
            {
                MarkComplete();
                return;
            }
            IsComplete = false;

            var eventArgs = new TaskHoursUpdatedEvent(this);

            HoursUpdated?.Invoke(this, eventArgs);

            if (eventArgs.CancelRequested)
            {
                HoursRemaining = currentHoursRemaining;
            }
        }
Exemplo n.º 2
0
 protected virtual void OnHoursUpdated()
 {
     HoursUpdated.OnNext(null);
 }