public void DownloadInfo() { Const_Request CR = new Const_Request(); _forms = CR.GetRequestFormPlaceMethod(); _categories = CR.GetRequestPlaceCategoriesMethod(); _types = CR.GetRequestTypesOf_UseMethod(); if (_forms != null && _categories != null && _types != null) { Dispatcher.BeginInvoke(new ThreadStart(delegate { Status = true; })); } secondThread.Abort(); }
private TypesOf_Use GetRequestTypesOf_Use <T>(string url) { try { var response = _httpClient.GetAsync(url).Result; response.EnsureSuccessStatusCode(); var content = response.Content.ReadAsStringAsync().Result; TypesOf_Use model = JsonConvert.DeserializeObject <TypesOf_Use>(content); return(model); } catch (Exception) { return(GetRequestTypesOf_Use <TypesOf_Use>($"arcgis/rest/services/Cadastre/Thematic/MapServer/6?f=pjson")); } }