Exemple #1
0
        protected virtual void OnCompleted()
        {
            var result = new WBWebCompletedArgs <T>
            {
                UniqueName = config.UniqueName,
                Result     = new T[Result.Count]
            };

            Result.CopyTo(result.Result, 0);

            RequestCompleted?.Invoke(result);
        }
Exemple #2
0
        private void TopicsRestService_RequestCompleted(WBWebCompletedArgs <TopicsTable> args)
        {
            var topicsIds = persistence.GetTopicsIdList();

            var indicatorsTasks = new List <Task>();

            foreach (var item in topicsIds)
            {
                var indicatorsWebRequest = new WBIndicatorsPerTopicWebServiceRest(
                    Convert.ToInt32(item), (items) => persistence.Insert(items));
                indicatorsWebRequest.RequestCompleted += IndicatorsWebRequest_RequestCompleted;
                indicatorsTasks.Add(Task.Factory.StartNew(() => indicatorsWebRequest.Read()));
            }

            Task.WaitAll(indicatorsTasks.ToArray());
        }
Exemple #3
0
 private void IndicatorsWebRequest_RequestCompleted(WBWebCompletedArgs <IndicatorsTable> args)
 {
     persistence.taskQueue.Complete();
 }