public MainWindow() { InitializeComponent(); controlcorride = new onofflamp { oncode = ADAM4150FuncID.OnCorridorLamp, offcode = ADAM4150FuncID.OffCorridorLamp, lampimg = imgc, buttonimg = imgcc, errormess = "操作楼道灯失败" }; controlstreet = new onofflamp { oncode = ADAM4150FuncID.OnStreetLamp, offcode = ADAM4150FuncID.OffStreetLamp, lampimg = imgs, buttonimg = imgsc, errormess = "操作街道灯失败" }; }