Ejemplo n.º 1
0
 public Form1()
 {
     m_car = new Car(15, 30, "Example Car");
     m_car.setSpeed(30);
     InitializeComponent();
     UpdateForm();
 }
Ejemplo n.º 2
0
        private void newCar_Click(object sender, EventArgs e)
        {
            NewCar c = new NewCar();

            c.ShowDialog();
            if (c.getCar() != null)
            {
                m_car = c.getCar();
                UpdateForm();
            }
        }
Ejemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         m_car = new Car(double.Parse(capTB.Text), double.Parse(mpgTB.Text), nameTB.Text);
     }
     catch (FormatException)
     {
         MessageBox.Show("Invalid Parameters. Car cannot be created.");
         return;
     }
     this.Close();
 }
Ejemplo n.º 4
0
        public carSettingsForm(ICarInterface c)
        {
            m_c = c;

            InitializeComponent();
        }