Added timer for updating sessions.

This commit is contained in:
Aareschluchtje
2015-10-16 11:56:06 +02:00
parent 1e97975bad
commit 5839452e20
2 changed files with 15 additions and 1 deletions
+9 -1
View File
@@ -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;
@@ -131,6 +133,11 @@ namespace ErgometerDoctorApplication
this.label2.TabIndex = 6;
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
//
@@ -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;
+6
View File
@@ -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));
}
}
}