Beispiel #1
0
        private void ProcessNextItemInUpdateQueue(object sender, ElapsedEventArgs e)
        {
            lock (this)
              {
            if (updateQueue.Count == 0)
            {
              updateTimer.Stop();
              Log("Script update check completed");
              return;
            }

            UpdateQueueItem queueItem = updateQueue[0];
            updateQueue.Remove(queueItem);

            try
            {
              var client = new XWebClient(2500);
              client.DownloadDataCompleted += ScriptFile_DownloadDataCompleted;
              client.DownloadDataAsync(queueItem.Uri, queueItem);
            }
            catch (Exception ex)
            {
              Log("Failed to get script source from " + queueItem.Uri + ": " + ex.Message);
            }
              }
        }