예제 #1
0
 public NewsWaitingState(MachineContext context, double time)
     : base(context)
 {
     this.timer = new Util.StaticTimer(context.RetryTimeout);
     this.queueTime = new Util.StaticTimer(TimeSpan.FromMilliseconds(time));
     this.retriesUsed = 0;
 }
예제 #2
0
 public NewsTransferState(MachineContext context, IState prev)
     : base(context)
 {
     this.prev = prev;
     this._timer = new Util.StaticTimer(TimeSpan.FromSeconds(8));
     this.queueMsg = new Queue<NewsMessage>();
 }
예제 #3
0
 public NewsCrawlerState(MachineContext context, IState prev)
     : base(context)
 {
     this.prev = prev;
     this._timer = new Util.StaticTimer(TimeSpan.FromMinutes(3));
     InitRssFeed();
 }
예제 #4
0
 public override void OnStart()
 {
     base.Start = true;
     this.waitingForOverlayAnimationCompleted = new Util.StaticTimer(TimeSpan.FromSeconds(10));
     Trace("[Overlay] Waiting for close...");
     base.Context.CloseOverlay(false);
 }
예제 #5
0
 public override void OnTimer()
 {
     if (base.Start)
     {
         if (openOverlay)
         {
             Trace("[Overlay] Created window");
             overlayAnimation = new Util.StaticTimer(TimeSpan.FromSeconds(9));
             openOverlay = false;
         }
         if (overlayAnimation != null && overlayAnimation.IsTimeout())
         {
             base.Context.SetState(new NewsQueueState(base.Context));
             base.Context.Start();
         }
         else if (waitingForOverlayAnimationCompleted.IsTimeout())
         {
             Trace("[Overlay] Waiting for animation completed...");
             waitingForOverlayAnimationCompleted.Restart();
         }
     }
 }
예제 #6
0
 public NewsBeginState(MachineContext context)
     : base(context)
 {
     waitingForOverlayAnimationCompleted = new Util.StaticTimer(TimeSpan.FromSeconds(1));
 }
예제 #7
0
 public override void OnStart()
 {
     base.Start = true;
     this._timer = new Util.StaticTimer(TimeSpan.FromMinutes(1));
 }
예제 #8
0
 public NewsEndState(MachineContext context)
     : base(context)
 {
     _timer = new Util.StaticTimer(TimeSpan.FromSeconds(1));
 }