コード例 #1
0
        /// <summary>
        /// A presence is received. Now check if its from a Jid we are looking for and
        /// raise the event in this case.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="pres"></param>
        private void m_connection_OnPresence(object sender, Presence pres)
        {
            if (pres == null)
            {
                return;
            }

            lock (m_grabbing)
            {
                IDictionaryEnumerator myEnum = m_grabbing.GetEnumerator();

                while (myEnum.MoveNext())
                {
                    TrackerData t = myEnum.Value as TrackerData;
                    if (t.comparer.Compare(new Jid((string)myEnum.Key), pres.From) == 0)
                    {
                        // Execute the callback
                        t.cb(this, pres, t.data);
                    }
                }
            }
        }