private void PlaceID_TextChanged(object sender, EventArgs e) { CurrentPlaceId = PlaceID.Text; if (PlaceTimer.Enabled) { PlaceTimer.Stop(); } PlaceTimer.Start(); }
private void PlaceTimer_Tick(object sender, EventArgs e) { if (apiclient == null) { return; } PlaceTimer.Stop(); RestRequest request = new RestRequest("Marketplace/ProductInfo?assetId=" + PlaceID.Text, Method.GET); request.AddHeader("Accept", "application/json"); IRestResponse response = response = apiclient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { ProductInfo placeInfo = JsonConvert.DeserializeObject <ProductInfo>(response.Content); CurrentPlace.Text = placeInfo.Name; } }