Send chat with old session

This commit is contained in:
2015-10-20 12:57:47 +02:00
parent 48b9e1365e
commit dfc4ab9b42
5 changed files with 12 additions and 8 deletions
@@ -50,7 +50,7 @@ namespace ErgometerDoctorApplication
window.Invoke(window.updateMetingen, new Object[] { command.Meting }); window.Invoke(window.updateMetingen, new Object[] { command.Meting });
break; break;
case NetCommand.CommandType.CHAT: case NetCommand.CommandType.CHAT:
ChatMessage chat = new ChatMessage(command.DisplayName, command.ChatMessage, false); ChatMessage chat = new ChatMessage(command.DisplayName, command.ChatMessage, command.IsDoctor);
Chat.Add(chat); Chat.Add(chat);
window.panelClientChat.Invoke(window.panelClientChat.passChatMessage, new Object[] { chat }); window.panelClientChat.Invoke(window.panelClientChat.passChatMessage, new Object[] { chat });
break; break;
@@ -17,8 +17,8 @@ namespace ErgometerDoctorApplication
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1; public System.Windows.Forms.Button button1;
private System.Windows.Forms.RichTextBox richTextBox1; public System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label connectionLabel; private System.Windows.Forms.Label connectionLabel;
@@ -153,7 +153,7 @@ namespace ErgometerDoctorApplication
if (richTextBox1.TextLength > 1) if (richTextBox1.TextLength > 1)
{ {
AddChatItem(new ChatMessage("Doctor", richTextBox1.Text, true)); AddChatItem(new ChatMessage("Doctor", richTextBox1.Text, true));
MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, Session)); MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, true, Session));
richTextBox1.ResetText(); richTextBox1.ResetText();
} }
} }
@@ -42,8 +42,11 @@ namespace ErgometerDoctorApplication
InitializeComponent(); InitializeComponent();
if (!ActiveSession) if(! ActiveSession)
panelClientChat.Visible = false; {
panelClientChat.richTextBox1.Enabled = false;
panelClientChat.button1.Enabled = false;
}
} }
public void ClientApplicatie_Resize(object sender, EventArgs e) public void ClientApplicatie_Resize(object sender, EventArgs e)
+2 -1
View File
@@ -96,7 +96,7 @@ namespace ErgometerDoctorApplication
loggedin = true; loggedin = true;
} }
SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, Session)); //SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, Session));
SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, Session)); SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, Session));
return true; return true;
@@ -256,6 +256,7 @@ namespace ErgometerDoctorApplication
return; return;
SendNetCommand(new NetCommand(NetCommand.RequestType.OLDDATA, session)); SendNetCommand(new NetCommand(NetCommand.RequestType.OLDDATA, session));
SendNetCommand(new NetCommand(NetCommand.RequestType.CHAT, session));
//Start new client //Start new client
ClientThread cl = new ClientThread(name, session, true); ClientThread cl = new ClientThread(name, session, true);
+1 -1
View File
@@ -67,7 +67,7 @@ namespace ErgometerDoctorApplication
this.HeaderLabel.Text = "Sessie geschiedenis"; this.HeaderLabel.Text = "Sessie geschiedenis";
conSessionHistory.BringToFront(); conSessionHistory.BringToFront();
MainClient.StartOldCLient("Test", 1148735907); MainClient.StartOldCLient("Test", 1907047993);
} }
public void validateLogin() public void validateLogin()
{ {