AIParkingApplicationForm - pass apiController thru Param.
This commit is contained in:
parent
8e537fba1b
commit
ee56086eff
|
@ -13,23 +13,22 @@ namespace AIParkingApplication
|
|||
private StatusBar statusBar;
|
||||
private Sidebar sidebar;
|
||||
|
||||
public AIParkingApplicationForm()
|
||||
public AIParkingApplicationForm(ApiController apiController)
|
||||
{
|
||||
InitializeComponent();
|
||||
string serverBaseAddress = "http://localhost:80/";
|
||||
apiController = new ApiController(serverBaseAddress);
|
||||
this.apiController = apiController;
|
||||
|
||||
sidebar = new Sidebar(apiController);
|
||||
sidebar.Location = new System.Drawing.Point(0, 0);
|
||||
Controls.Add(sidebar);
|
||||
|
||||
c3Device = new C3DeviceController("192.168.1.200");
|
||||
laneIn = new LaneIn(1, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, apiController, true, false, true);
|
||||
laneIn = new LaneIn(1, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, this.apiController, true, false, true);
|
||||
laneIn.BorderStyle = BorderStyle.FixedSingle;
|
||||
laneIn.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, 0);
|
||||
Controls.Add(laneIn);
|
||||
|
||||
laneOut = new LaneOut(2, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, apiController, true, false, true);
|
||||
laneOut = new LaneOut(2, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, this.apiController, true, false, true);
|
||||
laneOut.BorderStyle = BorderStyle.FixedSingle;
|
||||
laneOut.Location = new System.Drawing.Point(laneIn.Location.X + laneIn.Width + 20, 0);
|
||||
Controls.Add(laneOut);
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace AIParkingApplication
|
|||
var loginResult = await apiController.Login(new LoginModel { Username = username, Password = password });
|
||||
if (loginResult.IsLoginSuccess)
|
||||
{
|
||||
new AIParkingApplicationForm().Show();
|
||||
new AIParkingApplicationForm(apiController).Show();
|
||||
Hide();
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user