protected internal virtual void OnContactStatusChanged(ContactStatusChangedEventArgs e)
 {
     if (ContactStatusChanged != null)
         ContactStatusChanged(this, e);
 }
Example #2
0
 private void Nameserver_ContactOffline(object sender, ContactStatusChangedEventArgs e)
 {
     _msnConversations.CloseConversation(e.Contact);
 }
Example #3
0
 private void Nameserver_ContactOffline(object sender, ContactStatusChangedEventArgs e)
 {
     _msnConversations.CloseConversation(e.Contact);
 }
        protected internal virtual void OnContactOnline(ContactStatusChangedEventArgs e)
        {
            if (ContactOnline != null)
                ContactOnline(this, e);

            Trace.WriteLineIf(Settings.TraceSwitch.TraceVerbose,
                e.Contact.ToString() + " goes to " + e.NewStatus + " from " + e.OldStatus + (e.Via == null ? String.Empty : " via=" + e.Via.ToString()) + "\r\n", GetType().Name);
        }
Example #5
0
 void Nameserver_ContactOffline(object sender, ContactStatusChangedEventArgs e)
 {
     BeginInvoke(new EventHandler<ContactStatusChangedEventArgs>(ContactOnlineOffline), new object[] { sender, e });
 }
Example #6
0
 void ContactOnlineOffline(object sender, ContactStatusChangedEventArgs e)
 {
     if (toolStripSortByStatus.Checked)
         SortByStatus(e);
     else
         SortByGroup(e);
 }
Example #7
0
        private void SortByGroup(ContactStatusChangedEventArgs e)
        {
            this.treeViewFavoriteList.BeginUpdate();
            this.toolStripSortByStatus.Checked = false;

            SortByFavAndCircle(e);

            foreach (ContactGroup group in this.messenger.ContactGroups)
            {
                if (group.IsFavorite == false)
                {
                    TreeNode node = treeViewFavoriteList.Nodes.ContainsKey(group.Guid) ?
                        treeViewFavoriteList.Nodes[group.Guid] : treeViewFavoriteList.Nodes.Add(group.Guid, group.Name, ImageIndexes.Closed, ImageIndexes.Closed);

                    node.ImageIndex = ImageIndexes.Closed;
                    node.NodeFont = PARENT_NODE_FONT;
                    node.Tag = group;
                    node.Text = "0";
                }
            }

            TreeNode common = treeViewFavoriteList.Nodes.ContainsKey(ImageIndexes.NoGroupNodeKey) ?
                treeViewFavoriteList.Nodes[ImageIndexes.NoGroupNodeKey] : treeViewFavoriteList.Nodes.Add(ImageIndexes.NoGroupNodeKey, "Others", 0, 0);

            common.ImageIndex = ImageIndexes.Closed;
            common.NodeFont = PARENT_NODE_FONT;
            common.Tag = ImageIndexes.NoGroupNodeKey;
            common.Text = "0";

            foreach (Contact contact in messenger.ContactList.All)
            {
                string text = contact.Name;
                if (contact.PersonalMessage != null && !String.IsNullOrEmpty(contact.PersonalMessage.Message))
                {
                    text += " - " + contact.PersonalMessage.Message;
                }
                if (contact.Name != contact.Account)
                {
                    text += " (" + contact.Account + ")";
                }

                if (contact.ContactGroups.Count == 0)
                {
                    TreeNode newnode = common.Nodes.ContainsKey(contact.Hash) ?
                        common.Nodes[contact.Hash] : common.Nodes.Add(contact.Hash, text);

                    newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contact.Status);
                    newnode.NodeFont = contact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                    newnode.Tag = contact;
                    newnode.Text = text;

                    if (contact.Online)
                        common.Text = (Convert.ToInt32(common.Text) + 1).ToString();
                }
                else
                {
                    foreach (ContactGroup group in contact.ContactGroups)
                    {
                        if (group.IsFavorite == false)
                        {
                            TreeNode found = treeViewFavoriteList.Nodes[group.Guid];
                            TreeNode newnode = found.Nodes.Add(contact.Hash, contact.Name);
                            newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contact.Status);
                            newnode.NodeFont = contact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                            newnode.Tag = contact;

                            if (contact.Online)
                                found.Text = (Convert.ToInt32(found.Text) + 1).ToString();
                        }
                    }
                }
            }

            foreach (TreeNode nodeGroup in treeViewFavoriteList.Nodes)
            {
                if (nodeGroup.Tag is ContactGroup)
                {
                    nodeGroup.Text = ((ContactGroup)nodeGroup.Tag).Name + "(" + nodeGroup.Text + "/" + nodeGroup.Nodes.Count + ")";
                }
            }

            common.Text = "Others (" + common.Text + "/" + common.Nodes.Count + ")";

            treeViewFavoriteList.Sort();
            treeViewFavoriteList.EndUpdate();
            treeViewFavoriteList.AllowDrop = true;
        }
Example #8
0
        private void SortByStatus(ContactStatusChangedEventArgs e)
        {
            Contact contactToUpdate = (e != null) ? e.Contact : null;

            TreeNode selectedNode = treeViewFavoriteList.SelectedNode;
            bool isExpanded = (selectedNode != null && selectedNode.IsExpanded);

            //treeViewFavoriteList.BeginUpdate();

            if (toolStripSortBygroup.Checked)
                toolStripSortBygroup.Checked = false;

            SortByFavAndCircle(e);

            TreeNode onlineNode = null; // (0)
            TreeNode mobileNode = null; // (0)
            TreeNode offlineNode = null; // (0)

            if (treeViewFavoriteList.Nodes.ContainsKey(ImageIndexes.OnlineNodeKey))
            {
                onlineNode = treeViewFavoriteList.Nodes[ImageIndexes.OnlineNodeKey];
            }
            else
            {
                onlineNode = treeViewFavoriteList.Nodes.Add(ImageIndexes.OnlineNodeKey, "Online", ImageIndexes.Closed, ImageIndexes.Closed);
                onlineNode.NodeFont = contactToUpdate == null ? PARENT_NODE_FONT : (contactToUpdate.AppearOffline ? PARENT_NODE_FONT_BANNED : PARENT_NODE_FONT);
                onlineNode.Tag = ImageIndexes.OnlineNodeKey;
            }

            if (treeViewFavoriteList.Nodes.ContainsKey(ImageIndexes.MobileNodeKey))
            {
                mobileNode = treeViewFavoriteList.Nodes[ImageIndexes.MobileNodeKey];
            }
            else
            {
                mobileNode = treeViewFavoriteList.Nodes.Add(ImageIndexes.MobileNodeKey, "Mobile", ImageIndexes.Closed, ImageIndexes.Closed);
                mobileNode.NodeFont = PARENT_NODE_FONT;
                mobileNode.Tag = ImageIndexes.MobileNodeKey;
            }

            if (treeViewFavoriteList.Nodes.ContainsKey(ImageIndexes.OfflineNodeKey))
            {
                offlineNode = treeViewFavoriteList.Nodes[ImageIndexes.OfflineNodeKey];
            }
            else
            {
                offlineNode = treeViewFavoriteList.Nodes.Add(ImageIndexes.OfflineNodeKey, "Offline", ImageIndexes.Closed, ImageIndexes.Closed);
                offlineNode.NodeFont = PARENT_NODE_FONT;
                offlineNode.Tag = ImageIndexes.OfflineNodeKey;
            }

            // Re-sort all
            if (contactToUpdate == null)
            {
                #region Update whole list

                mobileNode.Nodes.Clear();
                onlineNode.Nodes.Clear();
                offlineNode.Nodes.Clear();

                foreach (Contact contact in messenger.ContactList.All)
                {
                    if (contact.IsHiddenContact)
                        continue;

                    string text = contact.Name;
                    if (contact.PersonalMessage != null && !String.IsNullOrEmpty(contact.PersonalMessage.Message))
                    {
                        text += " - " + contact.PersonalMessage.Message;
                    }
                    if (contact.Name != contact.Account)
                    {
                        text += " (" + contact.Account + ")";
                    }

                    TreeNode newnode = contact.Online ? onlineNode.Nodes.Add(contact.Hash, text) : offlineNode.Nodes.Add(contact.Hash, text);
                    newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contact.Status);
                    newnode.NodeFont = contact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                    newnode.Tag = contact;

                    if (contact.MobileAccess || contact.ClientType == IMAddressInfoType.Telephone)
                    {
                        TreeNode newnode2 = mobileNode.Nodes.Add(contact.Hash, text);
                        newnode2.ImageIndex = newnode2.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contact.Status);
                        newnode2.NodeFont = contact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                        newnode2.Tag = contact;
                    }
                }

                #endregion
            }
            else
            {
                if (contactToUpdate.IsHiddenContact)
                    return;

                if (contactToUpdate.Via != null)
                {

                    #region Circle Members

                    if (contactToUpdate.Via.ClientType == IMAddressInfoType.Circle)
                    {
                        UpdateCircleMember(contactToUpdate.Via, contactToUpdate);
                    }
                    #endregion

                    #region Facebook members

                    if (contactToUpdate.Via.ClientType == IMAddressInfoType.RemoteNetwork)
                    {
                        Contact fbNetwork = Messenger.ContactList.GetContact(contactToUpdate.Via.Account, contactToUpdate.Via.ClientType);

                        if (fbNetwork != null && fbNetwork.ContactList != null)
                        {
                            TreeNode fbNode = treeViewFavoriteList.Nodes[ImageIndexes.FacebookNodeKey];
                            string text2 = contactToUpdate.Name;

                            TreeNode newnode = fbNode.Nodes.ContainsKey(contactToUpdate.Hash) ?
                            fbNode.Nodes[contactToUpdate.Hash] : fbNode.Nodes.Add(contactToUpdate.Hash, text2);

                            newnode.Text = text2;
                            newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contactToUpdate.Status);
                            newnode.NodeFont = contactToUpdate.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                            newnode.Tag = contactToUpdate;

                        }
                    }

                    #endregion

                    return;
                }

                #region Update Circles

                if (contactToUpdate.ClientType == IMAddressInfoType.Circle)
                {
                    foreach (Contact contact in contactToUpdate.ContactList.All)
                    {
                        UpdateCircleMember(contactToUpdate, contact);
                    }

                    return;
                }

                #endregion


                TreeNode contactNode = null;

                if (contactToUpdate.Online)
                {
                    if (offlineNode.Nodes.ContainsKey(contactToUpdate.Hash))
                    {
                        offlineNode.Nodes.RemoveByKey(contactToUpdate.Hash);
                    }
                    if (onlineNode.Nodes.ContainsKey(contactToUpdate.Hash))
                    {
                        contactNode = onlineNode.Nodes[contactToUpdate.Hash];
                    }
                }
                else
                {
                    if (onlineNode.Nodes.ContainsKey(contactToUpdate.Hash))
                    {
                        onlineNode.Nodes.RemoveByKey(contactToUpdate.Hash);
                    }
                    if (offlineNode.Nodes.ContainsKey(contactToUpdate.Hash))
                    {
                        contactNode = offlineNode.Nodes[contactToUpdate.Hash];
                    }
                }

                string text = contactToUpdate.Name;
                if (contactToUpdate.PersonalMessage != null && !String.IsNullOrEmpty(contactToUpdate.PersonalMessage.Message))
                {
                    text += " - " + contactToUpdate.PersonalMessage.Message;
                }
                if (contactToUpdate.Name != contactToUpdate.Account)
                {
                    text += " (" + contactToUpdate.Account + ")";
                }

                if (contactNode == null)
                {
                    contactNode = contactToUpdate.Online ? onlineNode.Nodes.Add(contactToUpdate.Hash, text) : offlineNode.Nodes.Add(contactToUpdate.Hash, text);
                }

                if (contactNode.Text != text)
                    contactNode.Text = text;

                contactNode.ImageIndex = contactNode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contactToUpdate.Status);
                contactNode.NodeFont = contactToUpdate.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                contactNode.Tag = contactToUpdate;

                if (contactToUpdate.MobileAccess || contactToUpdate.ClientType == IMAddressInfoType.Telephone)
                {
                    TreeNode newnode2 = mobileNode.Nodes.ContainsKey(contactToUpdate.Hash) ?
                        mobileNode.Nodes[contactToUpdate.Hash] : mobileNode.Nodes.Add(contactToUpdate.Hash, text);

                    newnode2.ImageIndex = newnode2.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contactToUpdate.Status);
                    newnode2.NodeFont = contactToUpdate.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                    newnode2.Tag = contactToUpdate;
                }
            }

            string newText = "Online (" + onlineNode.Nodes.Count.ToString() + ")";
            if (onlineNode.Text != newText)
                onlineNode.Text = newText;

            newText = "Offline (" + offlineNode.Nodes.Count.ToString() + ")";
            if (offlineNode.Text != newText)
                offlineNode.Text = newText;

            newText = "Mobile (" + mobileNode.Nodes.Count.ToString() + ")";
            if (mobileNode.Text != newText)
                mobileNode.Text = newText;

            treeViewFavoriteList.Sort();

            if (selectedNode != null)
            {
                treeViewFavoriteList.SelectedNode = selectedNode;

                if (isExpanded && treeViewFavoriteList.SelectedNode != null)
                {
                    treeViewFavoriteList.SelectedNode.Expand();
                }
            }
            else
            {
                if (initialExpand && onlineNode.Nodes.Count > 0)
                {
                    onlineNode.Expand();
                    onlineNode.ImageIndex = ImageIndexes.Open;

                    initialExpand = false;
                }
            }

            //treeViewFavoriteList.EndUpdate();
            treeViewFavoriteList.AllowDrop = false;
        }
Example #9
0
        private void SortByFavAndCircle(ContactStatusChangedEventArgs e)
        {
            Contact contactToUpdate = (e != null) ? e.Contact : null;

            TreeNode favoritesNode = null; // (0/0)
            TreeNode circlesNode = null; // (0/0)
            TreeNode fbNode = null; // (0/0)

            if (treeViewFavoriteList.Nodes.ContainsKey(ImageIndexes.FavoritesNodeKey))
            {
                favoritesNode = treeViewFavoriteList.Nodes[ImageIndexes.FavoritesNodeKey];
            }
            else
            {
                favoritesNode = treeViewFavoriteList.Nodes.Add(ImageIndexes.FavoritesNodeKey, "Favorites", ImageIndexes.Closed, ImageIndexes.Closed);
                favoritesNode.NodeFont = PARENT_NODE_FONT;
                favoritesNode.Tag = ImageIndexes.FavoritesNodeKey;
            }

            if (treeViewFavoriteList.Nodes.ContainsKey(ImageIndexes.CircleNodeKey))
            {
                circlesNode = treeViewFavoriteList.Nodes[ImageIndexes.CircleNodeKey];
            }
            else
            {
                circlesNode = treeViewFavoriteList.Nodes.Add(ImageIndexes.CircleNodeKey, "Circles", ImageIndexes.Closed, ImageIndexes.Closed);
                circlesNode.NodeFont = PARENT_NODE_FONT;
                circlesNode.Tag = ImageIndexes.CircleNodeKey;
            }


            if (treeViewFavoriteList.Nodes.ContainsKey(ImageIndexes.FacebookNodeKey))
            {
                fbNode = treeViewFavoriteList.Nodes[ImageIndexes.FacebookNodeKey];
            }
            else
            {
                fbNode = treeViewFavoriteList.Nodes.Add(ImageIndexes.FacebookNodeKey, "Facebook", ImageIndexes.Closed, ImageIndexes.Closed);
                fbNode.NodeFont = PARENT_NODE_FONT;
                fbNode.Tag = ImageIndexes.FacebookNodeKey;
            }


            if (contactToUpdate == null)
            {
                // Initial sort
                favoritesNode.Nodes.Clear();
                circlesNode.Nodes.Clear();
                fbNode.Nodes.Clear();

                #region Circles and circle members

                foreach (Contact circle in Messenger.CircleList.Values)
                {
                    if (circle.ContactList != null)
                    {
                        int contactCount = circle.ContactList[IMAddressInfoType.None].Count;
                        TreeNode circleNode = circlesNode.Nodes.Add(circle.Hash, GetCircleDisplayName(circle, contactCount), circle.Online ? ImageIndexes.CircleOnline : ImageIndexes.CircleOffline, circle.Online ? ImageIndexes.CircleOnline : ImageIndexes.CircleOffline);
                        circleNode.NodeFont = circle.AppearOffline ? PARENT_NODE_FONT_BANNED : PARENT_NODE_FONT;
                        circleNode.Tag = circle;

                        foreach (Contact contact in circle.ContactList.All)
                        {
                            // Get real passport contact to chat with... If this contact isn't on our forward list, show add contact form...
                            string text = contact.Name;
                            if (contact.PersonalMessage != null && !String.IsNullOrEmpty(contact.PersonalMessage.Message))
                            {
                                text += " - " + contact.PersonalMessage.Message;
                            }
                            if (contact.Name != contact.Account)
                            {
                                text += " (" + contact.Account + ")";
                            }

                            TreeNode newnode = circleNode.Nodes.Add(contact.Hash, text);
                            newnode.NodeFont = contact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                            newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contact.Status);
                            newnode.Tag = contact;
                        }
                    }
                }

                #endregion

                #region Contacts

                ContactGroup favGroup = messenger.ContactGroups.FavoriteGroup;
                if (favGroup != null)
                {
                    foreach (Contact c in messenger.ContactList.Forward)
                    {
                        if (c.HasGroup(favGroup))
                        {
                            string text = c.Name;
                            if (c.PersonalMessage != null && !String.IsNullOrEmpty(c.PersonalMessage.Message))
                            {
                                text += " - " + c.PersonalMessage.Message;
                            }
                            if (c.Name != c.Account)
                            {
                                text += " (" + c.Account + ")";
                            }

                            TreeNode newnode = favoritesNode.Nodes.ContainsKey(c.Hash) ?
                                favoritesNode.Nodes[c.Hash] : favoritesNode.Nodes.Add(c.Hash, text);

                            newnode.NodeFont = c.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                            newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(c.Status);
                            newnode.Tag = c;
                        }
                    }
                }

                #endregion

                #region Facebook contacts.

                Contact fbNetwork = Messenger.ContactList.GetContact(RemoteNetworkGateways.FaceBookGatewayAccount, IMAddressInfoType.RemoteNetwork);

                if (fbNetwork != null && fbNetwork.ContactList != null)
                {
                    int onlineCountFB = 0;

                    foreach (Contact fbContact in fbNetwork.ContactList.All)
                    {
                        string text = fbContact.Name;

                        if (fbContact.Online)
                            onlineCountFB++;

                        TreeNode newnode = fbNode.Nodes.ContainsKey(fbContact.Hash) ?
                                fbNode.Nodes[fbContact.Hash] : fbNode.Nodes.Add(fbContact.Hash, text);

                        newnode.NodeFont = fbContact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                        newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(fbContact.Status);
                        newnode.Tag = fbContact;
                    }

                    string fbText = "Facebook (" + onlineCountFB + "/" + fbNode.Nodes.Count + ")";
                    if (fbNode.Text != fbText)
                        fbNode.Text = fbText;

                }

                #endregion
            }
            else if (contactToUpdate.ClientType == IMAddressInfoType.Circle)
            {
                // Circle event
                Contact circle = contactToUpdate;

                bool isDeleted = (!Messenger.CircleList.ContainsKey(circle.Hash));

                if (!isDeleted)
                {
                    int contactCount = circle.ContactList[IMAddressInfoType.None].Count;

                    TreeNode circleNode = circlesNode.Nodes.ContainsKey(circle.Hash) ?
                        circlesNode.Nodes[circle.Hash] : circlesNode.Nodes.Add(circle.Hash, GetCircleDisplayName(circle, contactCount), circle.Online ? ImageIndexes.CircleOnline : ImageIndexes.CircleOffline, circle.Online ? ImageIndexes.CircleOnline : ImageIndexes.CircleOffline);

                    circleNode.NodeFont = circle.AppearOffline ? PARENT_NODE_FONT_BANNED : PARENT_NODE_FONT;
                    circleNode.Tag = circle;

                    int count = 0;
                    foreach (Contact contact in circle.ContactList.All)
                    {
                        count++;
                        // Get real passport contact to chat with... If this contact isn't on our forward list, show add contact form...
                        string text2 = contact.Name;
                        if (contact.PersonalMessage != null && !String.IsNullOrEmpty(contact.PersonalMessage.Message))
                        {
                            text2 += " - " + contact.PersonalMessage.Message;
                        }
                        if (contact.Name != contact.Account)
                        {
                            text2 += " (" + contact.Account + ")";
                        }

                        TreeNode newnode = circleNode.Nodes.ContainsKey(contact.Hash) ?
                            circleNode.Nodes[contact.Hash] : circleNode.Nodes.Add(contact.Hash, text2);

                        newnode.Text = text2;
                        newnode.ImageIndex = newnode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contact.Status);
                        newnode.NodeFont = contact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                        newnode.Tag = contact;
                    }

                    circleNode.Text = GetCircleDisplayName(circle, circleNode.Nodes.Count);
                }
                else
                {
                    circlesNode.Nodes.RemoveByKey(circle.Hash);
                }
            }
            else
            {
                // Contact event... Contact is not null.
                // Favorite
                ContactGroup favGroup = messenger.ContactGroups.FavoriteGroup;
                if (favGroup != null && contactToUpdate.HasGroup(favGroup))
                {
                    Contact contact = messenger.ContactList.GetContact(contactToUpdate.Account, contactToUpdate.ClientType);
                    string text = contact.Name;
                    if (contact.PersonalMessage != null && !String.IsNullOrEmpty(contact.PersonalMessage.Message))
                    {
                        text += " - " + contact.PersonalMessage.Message;
                    }
                    if (contact.Name != contact.Account)
                    {
                        text += " (" + contact.Account + ")";
                    }

                    TreeNode contactNode = favoritesNode.Nodes.ContainsKey(contactToUpdate.Hash) ?
                        favoritesNode.Nodes[contactToUpdate.Hash] : favoritesNode.Nodes.Add(contactToUpdate.Hash, text);

                    contactNode.NodeFont = contact.AppearOffline ? USER_NODE_FONT_BANNED : USER_NODE_FONT;
                    contactNode.ImageIndex = contactNode.SelectedImageIndex = ImageIndexes.GetContactStatusImageIndex(contactToUpdate.Status);
                    contactNode.Tag = contactToUpdate;
                }
            }

            int onlineCount = 0;
            foreach (TreeNode nodeFav in favoritesNode.Nodes)
            {
                if (nodeFav.Tag is Contact && (((Contact)nodeFav.Tag).Online))
                {
                    onlineCount++;
                }
            }
            string newText = "Favorites (" + onlineCount + "/" + favoritesNode.Nodes.Count + ")";
            if (favoritesNode.Text != newText)
                favoritesNode.Text = newText;

            onlineCount = 0;
            foreach (TreeNode nodeCircle in circlesNode.Nodes)
            {
                if (nodeCircle.Tag is Contact && (((Contact)nodeCircle.Tag).Online))
                {
                    onlineCount++;
                }
            }

            newText = "Circles (" + onlineCount + "/" + circlesNode.Nodes.Count + ")";
            if (circlesNode.Text != newText)
                circlesNode.Text = newText;


            onlineCount = 0;
            foreach (TreeNode fbContactNode in fbNode.Nodes)
            {
                if ((((Contact)fbContactNode.Tag).Online))
                {
                    onlineCount++;
                }
            }

            newText = "Facebook (" + onlineCount + "/" + fbNode.Nodes.Count + ")";
            if (fbNode.Text != newText)
                fbNode.Text = newText;
        }
 private void OnNameServerContactOnline(object sender, ContactStatusChangedEventArgs e)
 {
     if (Log.IsErrorEnabled)
       {
     Log.Error("Contact online: " + e.Contact.Name);
       }
 }
Example #11
0
 protected virtual void NameserverContactStatusChanged(object sender, ContactStatusChangedEventArgs e)
 {
     Log.Debug(string.Format("{0}: {1} -> {2}", e.Contact.Mail, e.OldStatus, e.Contact.Status));
 }