本文整理匯總了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");
}
}
}