Fixed chat

This commit is contained in:
2015-10-19 17:31:17 +02:00
parent 42e9b18ab5
commit 14c332bd16
4 changed files with 7 additions and 4 deletions
@@ -20,7 +20,7 @@ namespace ErgometerApplication
this.setAppearance(isDoctor);
this.Controls.Add(this.messageLabel);
this.Controls.Add(this.timeLabel);
this.MinimumSize = new System.Drawing.Size(100, 40);
this.MinimumSize = new System.Drawing.Size(150, 60);
this.Name = "messageContainer";
this.Padding = new System.Windows.Forms.Padding(6);
@@ -31,7 +31,7 @@ namespace ErgometerApplication
this.messageLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.messageLabel.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.messageLabel.Location = new System.Drawing.Point(6, 6);
this.messageLabel.MaximumSize = new System.Drawing.Size(190, 0);
this.messageLabel.MaximumSize = new System.Drawing.Size(250, 0);
this.messageLabel.Size = new System.Drawing.Size(121, 20);
this.messageLabel.Text = message;
//
@@ -160,7 +160,7 @@ namespace ErgometerApplication
break;
case NetCommand.CommandType.CHAT:
Chat.Add(new ChatMessage(Name, command.ChatMessage, true));
Client.chat.AddChatItem(command.ChatMessage);
Client.chat.Invoke(Client.chat.passChatMessage, new Object[] {command.ChatMessage, Helper.MillisecondsToTime(command.Timestamp), true});
break;
case NetCommand.CommandType.RESPONSE:
Console.WriteLine(command.Response.ToString());
@@ -140,7 +140,7 @@ namespace ErgometerApplication
this.Name = "container";
this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.panel3_MouseWheel);
Form.CheckForIllegalCrossThreadCalls = false;
passChatMessage = new ChatDelegate(this.AddChatItem);
}
private void button1_Click(object sender, EventArgs e)
@@ -203,5 +203,8 @@ namespace ErgometerApplication
button1_Click(this, new EventArgs());
}
}
public delegate void ChatDelegate(string text, string time, bool isDoctor);
public ChatDelegate passChatMessage;
}
}