本文整理汇总了C#中ClientMessage.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ClientMessage.Add方法的具体用法?C# ClientMessage.Add怎么用?C# ClientMessage.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClientMessage
的用法示例。
在下文中一共展示了ClientMessage.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendConnectionMessage
private void SendConnectionMessage(Controller controller, string username, string password, string servername, string port)
{
ClientMessage message = new ClientMessage("connect");
message.Add("server", servername);
message.Add("port", port);
message.Add("username", username);
message.Add("password", password);
controller.message_pump.process_message(message);
}
示例2: StartChat
private void StartChat(string username, string alias)
{
Logger.log("Messenger: Sending notice of new chat.", Logger.Verbosity.moderate);
ClientMessage mess = new ClientMessage("newUser");
mess.Add("username", username);
this._controller.message_pump.process_message(mess);
this.SendUINotice("New chat has be started.");
UIMessage message = new UIMessage("startChat");
message.Add("username", username);
message.Add("alias", alias);
this._controller.message_pump.process_message(message);
}
示例3: on_userTextEntry_activate
public void on_userTextEntry_activate(System.Object o, EventArgs e)
{
if(this._current_chat == "")
{
Application.Invoke(delegate{ new Error("You must start a chat first."); });
}
else
{
ClientMessage message = new ClientMessage("userMessage");
message.Add("destination", this._current_chat);
message.Add("message", this.userTextEntry.Text);
message.Add("time", DateTime.Now.ToString());
this._controller.message_pump.process_message(message);
TextBuffer t = (TextBuffer)this._user_chats[this._current_chat];
t.Text += DateTime.Now.ToString() +" (you): "+this.userTextEntry.Text+"\n";
this._user_chats[this._current_chat] = t;
this.userTextEntry.Text = "";
}
}