Exemplo n.º 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;
 }
Exemplo n.º 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>();
 }
Exemplo n.º 3
0
 public NewsCrawlerState(MachineContext context, IState prev)
     : base(context)
 {
     this.prev = prev;
     this._timer = new Util.StaticTimer(TimeSpan.FromMinutes(3));
     InitRssFeed();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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();
         }
     }
 }
Exemplo n.º 6
0
 public NewsBeginState(MachineContext context)
     : base(context)
 {
     waitingForOverlayAnimationCompleted = new Util.StaticTimer(TimeSpan.FromSeconds(1));
 }
Exemplo n.º 7
0
 public override void OnStart()
 {
     base.Start = true;
     this._timer = new Util.StaticTimer(TimeSpan.FromMinutes(1));
 }
Exemplo n.º 8
0
 public NewsEndState(MachineContext context)
     : base(context)
 {
     _timer = new Util.StaticTimer(TimeSpan.FromSeconds(1));
 }