示例#1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "T:XmppChat" /> class.
        /// </summary>
        /// <param name = "session">The session.</param>
        /// <param name = "contact">The contact.</param>
        internal XmppChat(XmppSession session, XmppContact contact)
        {
            this.session = session;
            this.contact = contact;
            pendingMessages = new Queue<XmppMessage>();

            Subscribe();
        }
示例#2
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "T:XmppChat" /> class.
        /// </summary>
        /// <param name = "session">The session.</param>
        /// <param name = "contact">The contact.</param>
        internal XmppChat(XmppSession session, XmppContact contact)
        {
            this.session    = session;
            this.contact    = contact;
            pendingMessages = new Queue <XmppMessage>();

            Subscribe();
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref = "XmppContactResource" /> class.
        /// </summary>
        internal XmppContactResource(XmppSession session, XmppContact contact, XmppJid resourceId)
        {
            this.session    = session;
            this.contact    = contact;
            this.resourceId = resourceId;
            presence        = new XmppContactPresence(this.session);
            capabilities    = new XmppClientCapabilities();
            pendingMessages = new List <string>();

            Subscribe();
        }
示例#4
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "XmppContactResource" /> class.
        /// </summary>
        internal XmppContactResource(XmppSession session, XmppContact contact, XmppJid resourceId)
        {
            this.session = session;
            this.contact = contact;
            this.resourceId = resourceId;
            presence = new XmppContactPresence(this.session);
            capabilities = new XmppClientCapabilities();
            pendingMessages = new List<string>();

            Subscribe();
        }
示例#5
0
        /// <summary>
        ///   Closes this instance.
        /// </summary>
        public void Close()
        {
            if (ChatClosing != null)
            {
                ChatClosing(this, new EventArgs());
            }

            SendChatStateNotification(XmppChatStateNotification.Gone);
            pendingMessages.Clear();
            Unsubscribe();
            pendingMessages = null;

            if (ChatClosed != null)
            {
                ChatClosed(this, new EventArgs());
            }

            session = null;
            contact = null;
        }
示例#6
0
        /// <summary>
        ///   Closes this instance.
        /// </summary>
        public void Close()
        {
            if (ChatClosing != null)
            {
                ChatClosing(this, new EventArgs());
            }

            SendChatStateNotification(XmppChatStateNotification.Gone);
            pendingMessages.Clear();
            Unsubscribe();
            pendingMessages = null;

            if (ChatClosed != null)
            {
                ChatClosed(this, new EventArgs());
            }

            session = null;
            contact = null;
        }