示例#1
0
 // Donation timer tick event
 private void donationTimerTick(object sender, ElapsedEventArgs e)
 {
     if (Common.StreamRefresher.isOnline())
     {
         List <Objects.RecentDonation> recentDonations = WebCalls.downloadRecentDonations().Result;
         //Check to see if query failed
         if (recentDonations == null)
         {
             return;
         }
         if (recentDonations.Count > 0)
         {
             foreach (Objects.RecentDonation donation in recentDonations)
             {
                 Common.ChatClient.SendMessage(string.Format("NEW DONATION! {0} donated ${1} with the message '{2}'. Thanks for supporting the Black Crew!",
                                                             donation.Username, donation.Amount, donation.Message));
             }
             foreach (Objects.RecentDonation donation in Common.RecentDonations)
             {
                 recentDonations.Add(donation);
             }
             Common.RecentDonations = recentDonations;
         }
     }
 }