diff --git a/ErgometerApplication/.vs/ErgometerApplication/v14/.suo b/ErgometerApplication/.vs/ErgometerApplication/v14/.suo index d55e72b..5b04bd4 100644 Binary files a/ErgometerApplication/.vs/ErgometerApplication/v14/.suo and b/ErgometerApplication/.vs/ErgometerApplication/v14/.suo differ diff --git a/ErgometerApplication/ErgometerApplication/MainClient.cs b/ErgometerApplication/ErgometerApplication/MainClient.cs index ef6215e..9a2bfdf 100644 --- a/ErgometerApplication/ErgometerApplication/MainClient.cs +++ b/ErgometerApplication/ErgometerApplication/MainClient.cs @@ -159,7 +159,7 @@ namespace ErgometerApplication ParseValueSet(command); break; case NetCommand.CommandType.CHAT: - Chat.Add(new ChatMessage(Name, command.ChatMessage)); + Chat.Add(new ChatMessage(Name, command.ChatMessage, true)); Client.chat.AddChatItem(command.ChatMessage); break; case NetCommand.CommandType.RESPONSE: diff --git a/ErgometerApplication/ErgometerApplication/PanelClientChat.cs b/ErgometerApplication/ErgometerApplication/PanelClientChat.cs index 4753f69..b1eb161 100644 --- a/ErgometerApplication/ErgometerApplication/PanelClientChat.cs +++ b/ErgometerApplication/ErgometerApplication/PanelClientChat.cs @@ -139,26 +139,28 @@ namespace ErgometerApplication this.Location = new System.Drawing.Point(0, 0); this.Name = "container"; this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.panel3_MouseWheel); + + Form.CheckForIllegalCrossThreadCalls = false; } private void button1_Click(object sender, EventArgs e) { if (richTextBox1.TextLength > 1) { - AddChatItem(richTextBox1.Text, DateTime.Now.ToString("h:mm:ss tt"), false); + AddChatItem(richTextBox1.Text, Helper.MillisecondsToTime(Helper.Now), false); MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, MainClient.Session)); richTextBox1.ResetText(); } } - public void AddChatItem(string chatmessage) + public void AddChatItem(string text) { - - } + flowLayoutPanel1.Controls.Add(new ChatItem(text, Helper.MillisecondsToTime(Helper.Now), true)); + } public void AddChatItem(string text, bool isDoctor) { - flowLayoutPanel1.Controls.Add(new ChatItem(text, DateTime.Now.ToString("h:mm:ss tt"), isDoctor)); + flowLayoutPanel1.Controls.Add(new ChatItem(text, Helper.MillisecondsToTime(Helper.Now), isDoctor)); } public void AddChatItem(string text, string time, bool isDoctor) diff --git a/ErgometerApplication/ErgometerApplication/PanelLogin.cs b/ErgometerApplication/ErgometerApplication/PanelLogin.cs index 3969b12..e265523 100644 --- a/ErgometerApplication/ErgometerApplication/PanelLogin.cs +++ b/ErgometerApplication/ErgometerApplication/PanelLogin.cs @@ -81,6 +81,7 @@ namespace ErgometerApplication this.textBoxPassword.PasswordChar = '*'; this.textBoxPassword.Size = new System.Drawing.Size(167, 20); this.textBoxPassword.TabIndex = 2; + this.textBoxPassword.KeyDown += TextBoxPassword_KeyDown; // // textBoxUsername // @@ -138,6 +139,14 @@ namespace ErgometerApplication ((System.ComponentModel.ISupportInitialize)(this.pictureBoxBike)).EndInit(); } + private void TextBoxPassword_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + buttonLogin_Click(this, new EventArgs()); + } + } + public void buttonLogin_Click(object sender, EventArgs e) { string username = textBoxUsername.Text; diff --git a/ErgometerApplication/ErgometerApplication/bin/Debug/ErgometerLibrary.dll b/ErgometerApplication/ErgometerApplication/bin/Debug/ErgometerLibrary.dll index aff32cc..1e827cc 100644 Binary files a/ErgometerApplication/ErgometerApplication/bin/Debug/ErgometerLibrary.dll and b/ErgometerApplication/ErgometerApplication/bin/Debug/ErgometerLibrary.dll differ