示例#1
0
        public void Toggle(Action <Duration> onNext)
        {
            current = current.ToggledAndLogged(log);

            var previous = log.Aggregate(Duration.Zero, (a, b) => a + b);

            subscription.Dispose();
            subscription = current.LoggedTime
                           .Subscribe(current => onNext(current + previous));
        }
示例#2
0
 internal void Toggle(Action <Duration> onNext)
 {
     if (current.Running)
     {
         periods.Add(current.Stopped());
         current = new TaaskPeriod(clock);
     }
     else
     {
         current.Start(duration => onNext(duration + periods.Aggregate(Duration.Zero, (a, b) => a + b)));
     }
 }
示例#3
0
 // What about checks?
 public TaaskPeriods(IClock clock)
 {
     this.clock = clock;
     current    = new TaaskPeriod(clock);
 }