예제 #1
0
        private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
        {
            this.comboBox2.Items.Clear();
            CustomComboBoxItem ComboMaker = (CustomComboBoxItem)this.comboBox1.SelectedItem;

            Car1.maker = Convert.ToInt32(ComboMaker.tag.ToString());

            localhost2.modelws modelz = new localhost2.modelws();
            localhost2.Maker   Maker1 = new localhost2.Maker();

            int code = Convert.ToInt32(ComboMaker.tag.ToString());

            Maker1.maker = code;

            localhost2.reply mm = new localhost2.reply();
            try
            {
                mm = modelz.models(Maker1);
                MessageBox.Show(mm.reply0, "All Models From Selected Maker");
                string   mods     = mm.reply0.ToString();
                string[] modarray = mods.Split('&');
                int      mod_num  = modarray.Length;
                int      i        = 0;
                for (i = 0; i < mod_num; i++)
                {
                    string[] model_data = modarray[i].Split('_');
                    this.comboBox2.Items.Add(new CustomComboBoxItem(model_data[0], model_data[0]));
                }
            }
            catch
            {
                MessageBox.Show("Cannot Load Models, Check your internet connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                //MessageBox.Show("Failed To Load Models From www.alekz.eu/carz \n Check You Internet Connection"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
예제 #2
0
 /// <remarks/>
 public System.IAsyncResult Beginmodels(Maker Maker, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("models", new object[] {
         Maker
     }, callback, asyncState));
 }