Exemplo n.º 1
0
 protected override void Tick()
 {
     var xbox = XboxLive.FromGamerTag("dharun");
     if (!xbox.Success) return;
     foreach (var source in xbox.Friends.Select(x => new
         { Old = _old.Friends.FirstOrDefault(o => o.GamerTag == x.GamerTag), New = x }))
     {
         if(source.Old.IsOnline != source.New.IsOnline)
         {
             var n = source.New.IsOnline;
             Brain.ListenerManager.CurrentListener.Output(n ? source.New.Description : source.New.GamerTag + " has signed off of Xbox Live");
             continue;
         }
         if(source.New.IsOnline && source.Old.Presence != source.New.Presence)
         {
             Brain.ListenerManager.CurrentListener.Output(source.New.Description);
             ImageView.Create(source.New.LargeGamerTileUrl);
         }
     }
     _old = xbox;
 }
Exemplo n.º 2
0
 public XboxTicker()
     : base(1.Minutes())
 {
     _old = XboxLive.FromGamerTag("dharun");
 }