public void Load(ICar car, CarEngineTools t)
        {
            if (car != null && car.Engine != null)
            {
                this.BackColor = Color.Black;

                eng = car.Engine;
                tools = t;

                _Settings_mode = 0;
                _Settings_speed = 0;
                _Settings_throttle = 1;

                this.Invalidate();
                cb_mode.Items.Clear();
                cb_mode.DisplayMember = "mode";
                cb_mode.ValueMember = "index";
                foreach (KeyValuePair<int, string> mode in car.Engine.EngineModes)
                {
                    cb_mode.Items.Add(new ucSelectModel_EngineCurve_Mode(mode.Key, mode.Value));
                }

                if (cb_mode.Items.Count >= _Settings_mode)
                    cb_mode.SelectedIndex = _Settings_mode;
            }
        }
 public void Load(ICar car)
 {
     CarEngineTools t = new CarEngineTools(car);
     t.Scan();
     Load(car, t);
 }
Esempio n. 3
0
        void _models_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            string file = "";
            if (_models.SelectedItems.Count > 0)
                file = _models.SelectedItems[0].SubItems[2].Text;
            else if (_models.Items.Count == 0)
                return;
            else
                file = _models.Items[0].SubItems[2].Text;

            car = fGarage.Sim.Garage.CarFactory(fGarage.Mod, file);

            engineinfo = new CarEngineTools(car);
            engineinfo.Scan();

            UpdateLabels();

            ucEngine.Load(car, engineinfo);
            Resize();
        }