/// <summary> /// /// </summary> /// <param name="eCarType"></param> /// <param name="iID"></param> /// <returns></returns> private QueryResponse[] queryRetailer(CarQuery.EnumCarType eCarType, int iID) { QueryResponse[] arrResponses = new QueryResponse[0]; // Query cars from each dealer VolkswagenCarQuery objQuery = new VolkswagenCarQuery(eCarType, iID); try { arrResponses = objQuery.GetResponses(); #if false foreach (QueryResponse objResponse in arrResponses) { Console.Out.WriteLine("Got QueryResponse: " + objResponse.GetType()); foreach (DictionaryEntry d in objResponse) { Console.Out.WriteLine(d.Key + " = " + d.Value); } } #endif } catch (Exception e) { Debug.WriteLine("Got error: " + e.Message); } return(arrResponses); }
private void buttonGo_Click(object sender, EventArgs e) { if (buttonGo.Text == "GO") { if (textBoxPostCode.Text.Length == 0) { return; } //textBoxPostCode.Enabled = false; buttonGo.Text = "Abort"; _eCarType = CarQuery.EnumCarType.NEW; if (comboBoxCarType.SelectedText == "New") { _eCarType = CarQuery.EnumCarType.NEW; } else if (comboBoxCarType.SelectedText == "Used") { _eCarType = CarQuery.EnumCarType.USED; } else if (comboBoxCarType.SelectedText == "Service") { _eCarType = CarQuery.EnumCarType.SERVICE; } _strPostCode = textBoxPostCode.Text; _objWorker = new Thread(Worker); _objWorker.Start(); } else { buttonGo.Enabled = false; _bIsRunning = false; //_objWorker.Join(); textBoxPostCode.Enabled = true; buttonGo.Text = "GO"; buttonGo.Enabled = true; } }