我有很多模型来设置信息标签,但这看起来很丑。如何创建简短的代码?
case "2er Coupé":
auto BMW_2erCoupé = new auto(30.700f,1.850f,5,4.461f,420);
price_result_lbl.Text = BMW_2erCoupé.getSetPrice.ToString(euro);
weight_result_lbl.Text = BMW_2erCoupé.getSetWeight.ToString(kg);
seats_result_lbl.Text = BMW_2erCoupé.getSetSeats.ToString();
length_result_lbl.Text = BMW_2erCoupé.getSetLength.ToString(lenght);
power_result_lbl.Text = BMW_2erCoupé.getSetPower.ToString(ps);
modellView_img.Image = Properties.Resources._2erCoupé;
break;
case "330e Limousine":
auto BMW_330eLimousine = new auto(51.550f,2.300f,4.709f,292);
price_result_lbl.Text = BMW_330eLimousine.getSetPrice.ToString(euro);
weight_result_lbl.Text = BMW_330eLimousine.getSetWeight.ToString(kg);
seats_result_lbl.Text = BMW_330eLimousine.getSetSeats.ToString();
length_result_lbl.Text = BMW_330eLimousine.getSetLength.ToString(lenght);
power_result_lbl.Text = BMW_330eLimousine.getSetPower.ToString(ps);
modellView_img.Image = Properties.Resources._330eLimousine;
break;