Added timer for updating sessions.
This commit is contained in:
+9
-1
@@ -1,4 +1,5 @@
|
||||
using System.Windows.Forms;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ErgometerDoctorApplication
|
||||
{
|
||||
@@ -52,6 +53,7 @@ namespace ErgometerDoctorApplication
|
||||
this.conSessionHistory = new ErgometerDoctorApplication.ConSessionHistory();
|
||||
this.conSessionLibrary = new ErgometerDoctorApplication.ConSessionLibrary();
|
||||
this.conPanelLogin = new ErgometerDoctorApplication.ConPanelLogin(this);
|
||||
this.updateTimer = new Timer();
|
||||
MainContainer.Visible = false;
|
||||
panel1.Visible = false;
|
||||
MenuPanel.Visible = false;
|
||||
@@ -132,6 +134,11 @@ namespace ErgometerDoctorApplication
|
||||
this.label2.Text = "SESSIE BEHEER";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// updateTimer
|
||||
//
|
||||
this.updateTimer.Interval = 10000;
|
||||
this.updateTimer.Tick += new EventHandler(this.updateTimer_tick);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
@@ -298,6 +305,7 @@ namespace ErgometerDoctorApplication
|
||||
private Panel panel1;
|
||||
private Panel panel3;
|
||||
public Label HeaderLabel;
|
||||
public Timer updateTimer;
|
||||
public Panel MainContainer;
|
||||
public ConActiveSessions conActiveSessions;
|
||||
public ConSessionHistory conSessionHistory;
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace ErgometerDoctorApplication
|
||||
{
|
||||
InitializeComponent();
|
||||
conPanelLogin.BringToFront();
|
||||
updateTimer.Start();
|
||||
}
|
||||
|
||||
private void BtnActiveSessions_Click(object sender, EventArgs e)
|
||||
@@ -90,5 +91,10 @@ namespace ErgometerDoctorApplication
|
||||
conPanelLogin.Visible = true;
|
||||
conPanelLogin.BringToFront();
|
||||
}
|
||||
|
||||
private void updateTimer_tick(object sender, EventArgs e)
|
||||
{
|
||||
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user