本文整理汇总了C#中Jid类的典型用法代码示例。如果您正苦于以下问题:C# Jid类的具体用法?C# Jid怎么用?C# Jid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Jid类属于命名空间,在下文中一共展示了Jid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LeaveRoom
public void LeaveRoom(Room room)
{
_logger.DebugFormat(" LeaveRoom: Id: [{0}] Nickname: [{1}]", room.Id, room.NickName);
var jid = new Jid(room.Id);
_mucManager.LeaveRoom(jid, room.NickName);
RemoveRoomFromGrabbers(jid);
}
示例2: Message
public Message(string to, string body, string subject)
: this()
{
To = new Jid(to);
Body = body;
Subject = subject;
}
示例3: MucRoom
public MucRoom(Jid jid, string name, MucService mucService, IServiceProvider context)
{
if (jid == null)
{
throw new ArgumentNullException("jid");
}
if (mucService == null)
{
throw new ArgumentNullException("mucService");
}
if (context == null)
{
throw new ArgumentNullException("context");
}
this.mucService = mucService;
this.context = context;
Jid = jid;
Name = name;
members = new MucRoomMemberCollection(mucService.ServiceManager);
members.MemberAdded += BroadcastPresencesToMember;
members.MemberRemoved += members_MemberRemoved;
//Create handler
Handlers.Add(new MucRoomStanzaHandler(this));
Handlers.Add(new ServiceDiscoHandler(Jid));
}
示例4: XmppItem
/// <summary>
/// Initializes a new instance of the Item class.
/// </summary>
/// <param name="jid">The JID of the item.</param>
/// <param name="node">The node identifier of the item.</param>
/// <param name="name">The name of the item.</param>
/// <exception cref="ArgumentNullException">The jid parameter is
/// null.</exception>
public XmppItem(Jid jid, string node = null, string name = null)
{
jid.ThrowIfNull("jid");
Jid = jid;
Node = node;
Name = name;
}
示例5: XmppManager
/// <summary>
///
/// </summary>
/// <param name="sJid">S jid.</param>
/// <param name="sPassword">S password.</param>
public XmppManager(AuthInfo authInfo, XmppServiceDescription xmppServiceDescription, OTRKeyRing _OTRKeyRing, OpenPGPRing _OpenPGPRing, ConversationManager _conversationManager, AddressBook _addressBook, Logger _logger)
{
try
{
m_Logger = _logger;
m_OTRKeyRing = _OTRKeyRing;
m_OpenPGPRing = _OpenPGPRing;
m_AuthInfo = authInfo;
m_OwnJid = new Jid (m_AuthInfo.m_sId);
m_ClientConnection = new XmppClientConnection(m_OwnJid.Server);
m_Contacts = new Dictionary<string, string> ();
m_Logger.log(ELogLevel.LVL_INFO, "Trying to log in xmpp user", m_sModuleName);
m_ClientConnection.Open(m_OwnJid.User, m_AuthInfo.m_sPassword);
m_ConversationManager = _conversationManager;
m_AddressBook = _addressBook;
m_PresenceManager = new PresenceManager(m_AddressBook);
m_OtrConnections = new Dictionary<string, int>();
//register EventHandlers
m_ClientConnection.OnLogin += new ObjectHandler(onLogin);
m_ClientConnection.OnPresence += new PresenceHandler(OnPresence);
}
catch(Exception e) {
Console.Write (e.Message);
}
//info: message callback is registered in onRosterItem callback
}
示例6: CheckArgs
private void CheckArgs(Jid jid, Element element)
{
if (jid == null) throw new ArgumentNullException("jid");
if (element == null) throw new ArgumentNullException("element");
if (string.IsNullOrEmpty(element.TagName)) throw new ArgumentNullException("element.TagName");
if (string.IsNullOrEmpty(element.Namespace)) throw new ArgumentNullException("element.Namespace");
}
示例7: FriendControl
public FriendControl(XmppClientConnection conn,Jid jid)
{
XmppConn = conn;
MJid = jid;
NickName = MJid.User;
InitializeComponent();
headImgbak = ResClass.GetImgRes("big194");
bgImg = null;
this.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right)));
this.BackColor = Color.Transparent;
if (Environment.OSVersion.Version.Major >= 6)
{
f = new Font("微软雅黑", 9F, FontStyle.Regular);
}
else
{
f = new Font("宋体", 9F, FontStyle.Regular);
}
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
System.GC.Collect();
}
示例8: UserRosterItem
public UserRosterItem(Jid jid)
{
if (jid == null) throw new ArgumentNullException("jid");
Jid = new Jid(jid.Bare.ToLowerInvariant());
Groups = new List<string>();
}
示例9: Route
public Route(Element route, Jid from, Jid to, RouteType type) : this()
{
RouteElement = route;
From = from;
To = to;
Type = type;
}
示例10: frmGroupChat
public frmGroupChat(XmppClientConnection xmppCon, Jid roomJid)
{
InitializeComponent();
this.rtfSend.Select();
_roomJid = roomJid;
_xmppCon = xmppCon;
this.groupChatServerLabel.Text = "Room Name: " + _roomJid.User;
frmInputBox input = new frmInputBox("Nickname", "Nickname");
if (!Util.GroupChatForms.Contains(roomJid.Bare) && input.ShowDialog() == DialogResult.OK)
{
_nickname = input.Result;
Util.GroupChatForms.Add(roomJid.Bare.ToLower(), this);
this.Show();
}
else
{
return;
}
// Setup new Message Callback
_xmppCon.MessageGrabber.Add(roomJid, new BareJidComparer(), new MessageCB(MessageCallback), null);
// Setup new Presence Callback
_xmppCon.PresenceGrabber.Add(roomJid, new BareJidComparer(), new PresenceCB(PresenceCallback), null);
}
示例11: MucMark
public MucMark(Service service)
{
_jid = service.Jid;
_name = service.Name;
_time = DateTime.Now;
}
示例12: GetArchivedChatIds
/// <summary>
/// Fetch message history from the server.
///
/// The 'start' and 'end' attributes MAY be specified to indicate a date range.
///
/// If the 'with' attribute is omitted then collections with any JID are returned.
///
/// If only 'start' is specified then all collections on or after that date should be returned.
///
/// If only 'end' is specified then all collections prior to that date should be returned.
/// </summary>
/// <param name="pageRequest">Paging options</param>
/// <param name="start">Optional start date range to query</param>
/// <param name="end">Optional enddate range to query</param>
/// <param name="with">Optional JID to filter archive results by</param>
public XmppPage<ArchivedChatId> GetArchivedChatIds(XmppPageRequest pageRequest, DateTimeOffset? start = null, DateTimeOffset? end = null, Jid with = null)
{
pageRequest.ThrowIfNull();
var request = Xml.Element("list", xmlns);
if (with != null)
{
request.Attr("with", with.ToString());
}
if (start != null)
{
request.Attr("start", start.Value.ToXmppDateTimeString());
}
if (end != null)
{
request.Attr("end", end.Value.ToXmppDateTimeString());
}
var setNode = pageRequest.ToXmlElement();
request.Child(setNode);
var response = IM.IqRequest(IqType.Get, null, null, request);
if (response.Type == IqType.Error)
{
throw Util.ExceptionFromError(response, "Failed to get archived chat ids");
}
return new XmppPage<ArchivedChatId>(response.Data["list"], GetChatIdsFromStanza);
}
示例13: Utilisateur
public Utilisateur(Jid _id)
{
infos = new Infos(_id);
ID = _id;
WhatAmIDoing = new State(State.Types.Chatting);
}
示例14: IQ
public IQ(IqType type, Jid from, Jid to)
: this()
{
this.Type = type;
this.From = from;
this.To = to;
}
示例15: Send
public void Send(Jid to, string b)
{
Jid from = UserJid;
MetroTalkMessage m = new MetroTalkMessage();
// Send a message
agsXMPP.protocol.client.Message msg = new agsXMPP.protocol.client.Message();
msg.Type = agsXMPP.protocol.client.MessageType.chat;
msg.To = to;
msg.Body = b;
m.To = to;
m.Body = b;
m.From = from;
m.Date = DateTime.Now;
if (cm.conversations.ContainsKey(from.Bare))
{
IList<MetroTalkMessage> msgs = cm.conversations[from.Bare];
msgs.Add(m);
cm.conversations[from.Bare] = msgs;
}
else {
IList<MetroTalkMessage> msgs = new List<MetroTalkMessage>();
msgs.Add(m);
cm.conversations.Add(from.Bare, msgs);
}
cW.RefreshConversation();
xmppCon.Send(msg);
}