本文整理汇总了C#中Presence.AppendChild方法的典型用法代码示例。如果您正苦于以下问题:C# Presence.AppendChild方法的具体用法?C# Presence.AppendChild怎么用?C# Presence.AppendChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Presence
的用法示例。
在下文中一共展示了Presence.AppendChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: jc_OnBeforePresenceOut
private void jc_OnBeforePresenceOut(object sender, Presence pres)
{
Debug.Assert(Node != null, "Node is required");
pres.AppendChild(GetCaps(pres.OwnerDocument));
}
示例2: GotList
private void GotList(object sender, IQ iq, object state)
{
RetrieveParticipantsState rps = (RetrieveParticipantsState)state;
if (iq.Type == IQType.error)
{
rps.Callback(this, null, rps.State);
return;
}
/*
<iq from='[email protected]'
id='ban2'
to='[email protected]/throne'
type='result'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='outcast'
jid='[email protected]'>
<reason>Treason</reason>
</item>
</query>
</iq>
*/
ParticipantCollection parties = new ParticipantCollection();
AdminQuery query = (AdminQuery)iq.Query;
ParticipantCollection.Modification mod;
foreach (AdminItem item in query.GetItems())
{
Presence pres = new Presence(m_manager.Stream.Document);
pres.From = new JID(m_jid.User, m_jid.Server, item.Nick);
UserX x = new UserX(m_manager.Stream.Document);
RoomItem xi = x.RoomItem;
xi.Role = item.Role;
xi.Affiliation = item.Affiliation;
xi.Nick = item.Nick;
xi.JID = item.JID;
pres.AppendChild(x);
parties.Modify(pres, out mod);
}
rps.Callback(this, parties, rps.State);
}
示例3: HandleOnBeforePresenceOut
void HandleOnBeforePresenceOut(object sender, Presence pres)
{
Element vcardUpdateElem = new Element("x", "vcard-temp:x:update", m_Account.Client.Document);
Element photoElem = new Element("photo", m_Account.Client.Document);
vcardUpdateElem.AppendChild(photoElem);
if (GetAvatarHash(m_Account.Jid) != null) {
photoElem.InnerText = GetAvatarHash(m_Account.Jid);
}
pres.AppendChild(vcardUpdateElem);
}