StatusBar - Form Load start Thread to Update Info.
This commit is contained in:
parent
fbee2526c5
commit
a00d77133f
1
AIParkingApplication/StatusBar.Designer.cs
generated
1
AIParkingApplication/StatusBar.Designer.cs
generated
|
@ -136,6 +136,7 @@
|
|||
this.MinimumSize = new System.Drawing.Size(1366, 24);
|
||||
this.Name = "StatusBar";
|
||||
this.Size = new System.Drawing.Size(1366, 24);
|
||||
this.Load += new System.EventHandler(this.StatusBar_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace AIParkingApplication
|
|||
private string doorAccessControlDeviceIP;
|
||||
private TimeSpan updateInterval;
|
||||
private const string engineFilePath = @"\engine.bat";
|
||||
private Thread updateInfoThread;
|
||||
|
||||
public StatusBar(string webServerIP, string doorAccessControlDeviceIP, TimeSpan updateInterval)
|
||||
{
|
||||
|
@ -20,9 +21,7 @@ namespace AIParkingApplication
|
|||
this.webServerIP = webServerIP;
|
||||
this.doorAccessControlDeviceIP = doorAccessControlDeviceIP;
|
||||
this.updateInterval = updateInterval;
|
||||
Thread thrStatus = new Thread(new ThreadStart(UpdateStatus));
|
||||
thrStatus.IsBackground = true;
|
||||
thrStatus.Start();
|
||||
updateInfoThread = new Thread(new ThreadStart(UpdateStatus)) { IsBackground = true };
|
||||
}
|
||||
|
||||
private void UpdateStatus()
|
||||
|
@ -98,6 +97,11 @@ namespace AIParkingApplication
|
|||
public Color BackColor { get; set; }
|
||||
public Color ForeColor { get; set; }
|
||||
}
|
||||
|
||||
private void StatusBar_Load(object sender, EventArgs e)
|
||||
{
|
||||
updateInfoThread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user