private void updateTimer_tick(object sender, EventArgs e) { if (updateSession) { BtnActiveSessions_Click(this, new EventArgs()); updateSession = false; } if (request == 0) { MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, MainClient.Session)); } else if (request == 1) { MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session)); } else if (request == 2) { MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.ALLSESSIONS, MainClient.Session)); } request++; if (request > 2) { request = 0; } }
private void sendCommand(NetCommand command) { if (!IsOldData) { MainClient.SendNetCommand(command); } }
private void button1_Click(object sender, EventArgs e) { if (richTextBox1.TextLength > 1) { AddChatItem(new ChatMessage("Doctor", richTextBox1.Text, true)); MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, true, Session)); richTextBox1.ResetText(); } }
public MainWindow() { InitializeComponent(); MainClient.Init(this); updateSession = false; conPanelLogin.BringToFront(); request = 2; updateTimer.Start(); }
private void SessionPanel_Click(object sender, System.EventArgs e) { if (IsNew) { MainClient.StartNewClient(name, Session); } else { MainClient.StartOldClient(name, Session); } }
private void buttonCreate_Click(object sender, EventArgs e) { if (!MainClient.users.ContainsKey(textBoxUsername.Text)) { MainClient.SendNetCommand(new NetCommand(textBoxUsername.Text, textBoxPassword.Text, MainClient.Session)); MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, MainClient.Session)); textBoxUsername.Text = ""; Thread.Sleep(250); updateUsers(MainClient.users); } textBoxPassword.Text = ""; }
private void updateTimer_tick(object sender, EventArgs e) { if (request == 0) { MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, MainClient.Session)); } else if (request == 1) { MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session)); } else if (request == 2) { MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.ALLSESSIONS, MainClient.Session)); } request++; if (request > 2) { request = 0; } }
public void validateLogin() { string error = ""; bool connect = MainClient.Connect(conPanelLogin.textBoxPassword.Text, out error); if (connect) { conPanelLogin.textBoxPassword.Text = ""; conPanelLogin.labelLoginInfo.Text = ""; if (MainClient.activesessions.Count > 0) { conActiveSessions.labelActiveSessions.Text = ""; conActiveSessions.updateActiveSessions(MainClient.activesessions); } showDashboard(); } else { conPanelLogin.labelLoginInfo.Text = error; showLoginScreen(); } }
private void buttonLogout_Click(object sender, EventArgs e) { MainClient.Disconnect(); showLoginScreen(); }
public void stop() { window.Close(); MainClient.RemoveActiveClient(this); }
private void Window_FormClosed(object sender, FormClosedEventArgs e) { MainClient.RemoveActiveClient(this); }
private void buttonBroadcast_Click(object sender, EventArgs e) { MainClient.SendNetCommand(new ErgometerLibrary.NetCommand(textBoxBroadcast.Text, MainClient.Session)); textBoxBroadcast.Text = ""; }