本文整理汇总了C#中jabber类的典型用法代码示例。如果您正苦于以下问题:C# jabber类的具体用法?C# jabber怎么用?C# jabber使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
jabber类属于命名空间,在下文中一共展示了jabber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XDataForm
/// <summary>
/// Create an x:data form from the given iq stanza.
/// </summary>
/// <param name="parent">Original stanza</param>
public XDataForm(jabber.protocol.client.IQ parent) : this(FindData(parent))
{
m_stanza = (Packet) parent.CloneNode(true);
Data d = FindData(m_stanza);
m_parent = (Element)d.ParentNode;
m_parent.RemoveChild(d);
}
示例2: m_node_OnItemAdd
private void m_node_OnItemAdd(PubSubNode node, jabber.protocol.iq.PubSubItem item)
{
// OnItemRemove should have fired first, so no reason to remove it here.
// Hopefully.
Debug.Assert(lbID.Items.IndexOf(item.ID) == -1);
lbID.Items.Add(item.ID);
}
示例3: AddRosterItemComplete
void AddRosterItemComplete(object sender, jabber.protocol.client.IQ response, object data)
{
if (response.Type != jabber.protocol.client.IQType.set) {
QApplication.Invoke(delegate {
QMessageBox.Critical(Gui.MainWindow, "Failed to add octy", "Server returned an error.");
});
}
}
示例4: m_node_OnItemRemove
private void m_node_OnItemRemove(PubSubNode node, jabber.protocol.iq.PubSubItem item)
{
int index = lbID.Items.IndexOf(item.ID);
if (lbID.SelectedIndex == index)
rtItem.Clear();
if (index >= 0)
lbID.Items.RemoveAt(index);
}
示例5: LolChatUser
public LolChatUser(string jid, string nickname, string @group, string status, jabber.protocol.iq.Item item)
{
Item = item;
Jid = jid;
_nickname = nickname;
_group = @group;
_status = status;
}
示例6: User
public User(string JID, string Nickname, string Group, string status, jabber.protocol.iq.Item _item)
{
item = _item;
_JID = JID;
_Nickname = Nickname;
_Group = Group;
_status = status;
}
示例7: ChatClient_OnMessage
//Blink and add to notification list if messaged
void ChatClient_OnMessage(object sender, jabber.protocol.client.Message msg)
{
//If is special message, don't show popup
if (msg.Subject != null)
{
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
{
ChatSubjects subject = (ChatSubjects)Enum.Parse(typeof(ChatSubjects), msg.Subject, true);
if ((subject == ChatSubjects.PRACTICE_GAME_INVITE ||
subject == ChatSubjects.GAME_INVITE) &&
Client.NotificationContainer.Visibility != System.Windows.Visibility.Visible)
{
NotificationButton.Content = ".";
}
}));
return;
}
if (Client.AllPlayers.ContainsKey(msg.From.User) && !String.IsNullOrWhiteSpace(msg.Body))
{
ChatPlayerItem chatItem = Client.AllPlayers[msg.From.User];
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
{
NotificationChatPlayer player = null;
foreach (NotificationChatPlayer x in ChatListView.Items)
{
if (x.PlayerName == chatItem.Username)
{
player = x;
break;
}
}
if (player == null)
{
player = new NotificationChatPlayer();
player.Tag = chatItem;
player.PlayerName = chatItem.Username;
player.Margin = new Thickness(1, 0, 1, 0);
player.PlayerLabelName.Content = chatItem.Username;
Client.ChatListView.Items.Add(player);
}
if (Client.ChatItem != null)
{
if ((string)Client.ChatItem.PlayerLabelName.Content != chatItem.Username)
{
player.BlinkRectangle.Visibility = System.Windows.Visibility.Visible;
}
}
else
{
player.BlinkRectangle.Visibility = System.Windows.Visibility.Visible;
}
}));
}
}
示例8: InsertMessage
/// <summary>
/// Insert the given message into the history. The timestamp on the message will be used, if
/// included, otherwise the current time will be used.
/// Messages without bodies will be ignored.
/// </summary>
/// <param name="msg"></param>
public void InsertMessage(jabber.protocol.client.Message msg)
{
string body = msg.Body;
if (body == null)
return; // typing indicator, e.g.
string nick = (m_nick == null) ? msg.From.Resource : m_nick;
AppendMaybeScroll(m_recvColor, nick + ":", body);
}
示例9: SendMessage
public SendMessage(jabber.client.JabberClient jc)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
m_jc = jc;
}
示例10: LoadVCard
public void LoadVCard(jabber.JID jid)
{
Text = string.Format ("Information for {0}", jid.Bare);
JidLabel.Text = jid.Bare;
jabber.protocol.iq.VCardIQ iq = XmppGlobal.Queries.CreateVCardQuery ();
iq.To = new jabber.JID (jid.Bare);
iq.Type = jabber.protocol.client.IQType.get;
XmppGlobal.Queries.SendQuery (iq, new QueryCallback (GotVCard), null);
}
示例11: LoadEntityTime
public void LoadEntityTime(jabber.JID jid)
{
TimeIQ iq = XmppGlobal.Queries.CreateTimeQuery ();
iq.To = jid;
XmppGlobal.Queries.SendQuery (iq, new QueryCallback (GotTimeQuery), null);
JidLabel.Text = jid.ToString ();
Spinner.Visible = true;
}
示例12: ChatClient_OnMessage
public void ChatClient_OnMessage(object sender, jabber.protocol.client.Message msg)
{
if (Client.AllPlayers.ContainsKey(msg.From.User) && !String.IsNullOrWhiteSpace(msg.Body))
{
ChatPlayerItem chatItem = Client.AllPlayers[msg.From.User];
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
{
if ((string)Client.ChatItem.PlayerLabelName.Content == chatItem.Username)
{
Update();
}
}));
}
}
示例13: SubscriptionRequestDialog
public SubscriptionRequestDialog(jabber.protocol.client.Presence request)
{
InitializeComponent ();
this.request = request;
RequestLabel.Text = string.Format ("{0} would like to add you to their contact list. Is this OK?", request.From.Bare);
AddCheckBox.Visible = false;
if (!XmppGlobal.Roster.ContainsKey (request.From))
if (!XmppGlobal.Roster.ContainsKey (new jabber.JID (request.From.Bare)))
AddCheckBox.Visible = true;
}
示例14: MessageWindow
public MessageWindow(jabber.JID jid)
{
InitializeComponent ();
foreign_jid = jid;
thread_id = Guid.NewGuid ().ToString ().Replace ("-", "");
UserAvatar.Image = XmppImages.DefaultAvatar;
Activated += new EventHandler (MessageWindow_Activated);
FormClosing += new FormClosingEventHandler (MessageWindow_FormClosing);
Load += new EventHandler (MessageWindow_Load);
OutgoingTextBox.KeyDown += new KeyEventHandler (OutgoingTextBox_KeyDown);
RichTextBox1.LinkClicked += new LinkClickedEventHandler (RichTextBox1_LinkClicked);
SendButton.Click += new EventHandler (SendButton_Click);
}
示例15: _jabberClient_OnMessage
public void _jabberClient_OnMessage(object sender, jabber.protocol.client.Message msg)
{
if (!this.ReceiveFlag)
{
if (msg.From.Bare == this.MailId)
{
if (msg.Body != "")
{
string receivedMsg = msg.From.User + " Says : " + msg.Body + "\n";
AppendConversation(receivedMsg);
msg.Body = "";
}
}
}
}