本文整理汇总了C#中System.Windows.Forms.Message.get_From方法的典型用法代码示例。如果您正苦于以下问题:C# Message.get_From方法的具体用法?C# Message.get_From怎么用?C# Message.get_From使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Message
的用法示例。
在下文中一共展示了Message.get_From方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XmppCon_OnMessage
private void XmppCon_OnMessage(object sender, Message msg)
{
if (base.InvokeRequired)
{
base.BeginInvoke(new OnMessageDelegate(this.XmppCon_OnMessage), new object[] { sender, msg });
}
else if ((msg.get_Type() != 2) && (msg.get_Type() != 0))
{
Element element = msg.SelectSingleElement(typeof(Data));
if (element != null)
{
Data data = element as Data;
if (data.get_Type() == 0)
{
frmXData data2 = new frmXData(data);
data2.Text = "xData Form from " + msg.get_From().ToString();
data2.Show();
}
}
else if (!Util.ChatForms.ContainsKey(msg.get_From().get_Bare()))
{
RosterNode rosterItem = this.rosterControl.GetRosterItem(msg.get_From());
string nickname = msg.get_From().get_Bare();
if (rosterItem != null)
{
nickname = rosterItem.Text;
}
frmChat chat = new frmChat(msg.get_From(), this.XmppCon, nickname);
chat.CreateControl();
chat.Show();
chat.IncomingMessage(msg);
}
}
}
示例2: IncomingMessage
private void IncomingMessage(Message msg)
{
if (msg.get_Type() != 0)
{
if (msg.get_Subject() != null)
{
this.txtSubject.Text = msg.get_Subject();
this.rtfChat.SelectionColor = Color.DarkGreen;
this.rtfChat.AppendText(msg.get_From().get_Resource() + " changed subject: ");
this.rtfChat.SelectionColor = Color.Black;
this.rtfChat.AppendText(msg.get_Subject());
this.rtfChat.AppendText("\r\n");
}
else if (msg.get_Body() != null)
{
this.rtfChat.SelectionColor = Color.Red;
this.rtfChat.AppendText(msg.get_From().get_Resource() + " said: ");
this.rtfChat.SelectionColor = Color.Black;
this.rtfChat.AppendText(msg.get_Body());
this.rtfChat.AppendText("\r\n");
}
}
}