Пример #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();
        }
Пример #3
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "XmppRoster" /> class
        /// </summary>
        internal XmppRoster(XmppSession session)
        {
            this.session    = session;
            connection      = session.Connection;
            contacts        = new ObservableCollection <XmppContact>();
            pendingMessages = new List <string>();

            SubscribeToSessionState();
        }
Пример #4
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "T:XmppContact" /> class.
        /// </summary>
        /// <param name = "session">The session.</param>
        /// <param name = "contactId">The contact id.</param>
        /// <param name = "name">The name.</param>
        /// <param name = "subscription">The subscription.</param>
        /// <param name = "groups">The groups.</param>
        internal XmppContact(XmppSession session, string contactId, string name,
                             XmppContactSubscriptionType subscription, IList<string> groups)
        {
            this.session = session;
            syncObject = new object();
            this.contactId = contactId;
            resources = new List<XmppContactResource>();

            RefreshData(name, subscription, groups);
            AddDefaultResource();
        }
Пример #5
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "T:XmppContact" /> class.
        /// </summary>
        /// <param name = "session">The session.</param>
        /// <param name = "contactId">The contact id.</param>
        /// <param name = "name">The name.</param>
        /// <param name = "subscription">The subscription.</param>
        /// <param name = "groups">The groups.</param>
        internal XmppContact(XmppSession session, string contactId, string name,
                             XmppContactSubscriptionType subscription, IList <string> groups)
        {
            this.session   = session;
            syncObject     = new object();
            this.contactId = contactId;
            resources      = new List <XmppContactResource>();

            RefreshData(name, subscription, groups);
            AddDefaultResource();
        }
Пример #6
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();
        }
Пример #7
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();
        }
Пример #8
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;
        }
Пример #9
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "XmppPresence" /> class using
 ///   the given session.
 /// </summary>
 /// <param name = "session"></param>
 internal XmppPresence(XmppSession session)
 {
     this.session = session;
 }
Пример #10
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "">XmppContactPresence</see>
 /// </summary>
 /// <param name = "session"></param>
 internal XmppContactPresence(XmppSession session)
 {
     this.session   = session;
     presenceStatus = XmppPresenceState.Offline;
 }
Пример #11
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "XmppPresence" /> class using
 ///   the given session.
 /// </summary>
 /// <param name = "session"></param>
 internal XmppPresence(XmppSession session)
 {
     this.session = session;
 }
Пример #12
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;
        }
Пример #13
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "">XmppContactPresence</see>
 /// </summary>
 /// <param name = "session"></param>
 internal XmppContactPresence(XmppSession session)
 {
     this.session = session;
     presenceStatus = XmppPresenceState.Offline;
 }