コード例 #1
0
        /// <summary>
        /// Loads the repository from whatever backing data store is most appropriate
        /// </summary>
        public void Load()
        {
            var client = new RestClient(Config.DeltaApiRoot);
            var request = new RestRequest("Change", Method.GET);
            request.AddParameter("channel", SettingsRepository.PushChannelUri);

            client.ExecuteAsync(request, resp =>
                                             {
                                                 _repository = new ChangeList();
                                                 if (resp.StatusCode == HttpStatusCode.OK)
                                                 {
                                                     JArray jsonArray = JArray.Parse(resp.Content);
                                                     _repository.AddRange(from ch in jsonArray.AsJEnumerable()
                                                                          select CreateChangeEntity(ch));
                                                 }

                                                 if (LoadCompleted != null)
                                                     LoadCompleted(this, new EventArgs());
                                             });
        }
コード例 #2
0
        /// <summary>
        /// Loads the repository from whatever backing data store is most appropriate
        /// </summary>
        public void Load()
        {
            var client  = new RestClient(Config.DeltaApiRoot);
            var request = new RestRequest("Change", Method.GET);

            request.AddParameter("channel", SettingsRepository.PushChannelUri);

            client.ExecuteAsync(request, resp =>
            {
                _repository = new ChangeList();
                if (resp.StatusCode == HttpStatusCode.OK)
                {
                    JArray jsonArray = JArray.Parse(resp.Content);
                    _repository.AddRange(from ch in jsonArray.AsJEnumerable()
                                         select CreateChangeEntity(ch));
                }

                if (LoadCompleted != null)
                {
                    LoadCompleted(this, new EventArgs());
                }
            });
        }