本文整理汇总了C#中jabber.JID.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# JID.ToString方法的具体用法?C# JID.ToString怎么用?C# JID.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jabber.JID
的用法示例。
在下文中一共展示了JID.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChatHandler
public ChatHandler(Account account, bool isMucUser, JID jid)
: base(account)
{
m_Jid = jid;
m_IsMucUser = isMucUser;
base.Account.ConnectionStateChanged += HandleConnectionStateChanged;
base.Ready = (base.Account.ConnectionState == AccountConnectionState.Connected);
base.AppendStatus(String.Format("Conversation with {0}.", jid.ToString()));
}
示例2: Test_Create
[Test] public void Test_Create()
{
JID j = new JID("foo", "jabber.com", "there");
Assert.AreEqual("[email protected]/there", j.ToString());
j = new JID(null, "jabber.com", null);
Assert.AreEqual("jabber.com", j.ToString());
j = new JID("foo", "jabber.com", null);
Assert.AreEqual("[email protected]", j.ToString());
j = new JID(null, "jabber.com", "there");
Assert.AreEqual("jabber.com/there", j.ToString());
}
示例3: m_pres_OnPrimarySessionChange
private void m_pres_OnPrimarySessionChange(object sender, JID bare)
{
Presence pres = m_pres[bare];
LinkedList nodelist = (LinkedList) m_items[bare.ToString()];
if (nodelist == null)
return;
foreach (ItemNode n in nodelist)
{
n.ChangePresence(pres);
}
}
示例4: ReceiveMessage
private Message ReceiveMessage(JID inJId, NUnit.Framework.Constraints.Constraint inMatcher)
{
Message result;
Assert.That(mQueue.TryPoll(TimeSpan.FromSeconds(5), out result), Is.True, "5秒間に何らかのメッセージが送られてこなければならない");
Assert.That(result, Is.Not.Null);
Assert.That(result.Body, inMatcher);
Assert.That(result.From.ToString(), Is.EqualTo(inJId.ToString()));
return result;
}
示例5: OpenChatWindow
public void OpenChatWindow(JID jid, bool isMucUser, bool focus, ChatHandlerEvent callback)
{
QApplication.Invoke(delegate {
IChatHandler handler = null;
string windowJid = isMucUser ? jid.ToString() : jid.Bare;
lock (m_ChatWindows) {
if (!m_ChatWindows.ContainsKey(windowJid)) {
handler = new ChatHandler(m_Account, isMucUser, windowJid);
var window = new ChatWindow(handler);
window.Closed += HandleChatWindowClosed;
m_ChatWindows.Add(windowJid, window);
Gui.TabbedChatsWindow.AddChatWindow(window, focus);
} else {
var window = m_ChatWindows[windowJid];
if (focus) {
Gui.TabbedChatsWindow.FocusChatWindow(window);
}
handler = (ChatHandler)window.Handler;
}
}
if (callback != null) {
callback(handler);
}
});
}
示例6: IsUserOnline
/// <summary>Is the peer online to the best of our knowledge.</summary>
public bool IsUserOnline(JID jid)
{
if(!_online.ContainsKey(jid.ToString())) {
return jid.Equals(_jc.JID);
}
return true;
}
示例7: SendTo
/// <summary>Send a Query to a remote peer.</summary>
public bool SendTo(Element msg, JID to)
{
if(!_online.ContainsKey(to.ToString())) {
return false;
}
SendByIQ(msg, to);
return true;
}
示例8: ReceivedMood
void ReceivedMood(JID from, string node, PubSubItem item)
{
Mood mood = (Mood)item["mood"];
m_FriendMoods[from.Bare] = mood;
// Only show in feed if we know this is a recent event.
if (mood["timestamp"] != null && DateTime.Now.Subtract(DateTime.Parse(mood["timestamp"].InnerText)).TotalSeconds <= 60) {
m_Account.PostActivityFeedItem(from.ToString(), "mood", mood.MoodName, mood.Text);
}
}