⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contactlistcontrol.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 5 页
字号:
                        while (enumerator.MoveNext())
                        {
                            ContactChangedEventArgs args = enumerator.get_Current();
                            Imps.Client.Core.Contact contact = args.Contact;
                            if (args.ContactEventType == ContactEventType.PresenceChanged)
                            {
                                this.cacheContactPresenceChanged(args);
                            }
                            else
                            {
                                if (args.ContactEventType == ContactEventType.PropertiesChanged)
                                {
                                    if (args.ContactInfoPropertiesChangedEventArgs.ContainsAnyOfProperties(new string[] { "nickname", "name", "DisplayName", "impresa" }))
                                    {
                                        this.cacheContactInfoChanged(contact);
                                    }
                                    if (args.ContactInfoPropertiesChangedEventArgs.ContainsProperty("Portrait"))
                                    {
                                        this.m_buddytree_widget.update_contact_info(contact, ContactEventType.PropertiesChanged, false, true);
                                    }
                                    continue;
                                }
                                if (args.ContactEventType == ContactEventType.Added)
                                {
                                    this.contactNodes_Add(contact);
                                    this.m_buddytree_widget.sort_allitems(true);
                                }
                                else
                                {
                                    if (args.ContactEventType == ContactEventType.BlockChanged)
                                    {
                                        this.m_buddytree_widget.update_contact_info(contact, ContactEventType.BlockChanged, false, true);
                                        continue;
                                    }
                                    if (args.ContactEventType == ContactEventType.BelongGroupChanged)
                                    {
                                        this.contactNodes_Update(contact);
                                        this.m_buddytree_widget.sort_allitems(true);
                                        continue;
                                    }
                                    if (args.ContactEventType == ContactEventType.Deleted)
                                    {
                                        this.contactNodes_Delete(contact);
                                    }
                                }
                            }
                        }
                    }
                    finally
                    {
                        enumerator.Dispose();
                    }
                }
            }
            catch (Exception exception)
            {
                this.m_buddytree_widget.sort_allitems(true);
                ClientLogger.WriteGeneral("ContactListControl", exception.ToString(), 10);
            }
        }

        private void contactList_ContactGroupChanged(object sender, ContactGroupChangedEventArgs e)
        {
            try
            {
                if (this.CurrentUser.Status == UserAccountStatus.Logon)
                {
                    if (e.Type == ContactGroupEventType.NameChanged)
                    {
                        this.m_buddytree_widget.rename_group(e.ContactGroup, e.ContactGroup.DisplayName, true);
                    }
                    else if (e.Type == ContactGroupEventType.Added)
                    {
                        if (this._currentTreeGroupByType == ContactTreeGroupByType.Group)
                        {
                            this.m_buddytree_widget.add_group_sorted(e.ContactGroup, true);
                        }
                    }
                    else if (e.Type == ContactGroupEventType.Deleted)
                    {
                        this.m_buddytree_widget.remove_group(e.ContactGroup, true);
                    }
                }
            }
            catch (Exception exception)
            {
                this.m_buddytree_widget.sort_allitems(true);
                ClientLogger.WriteGeneral("ContactListControl", exception.ToString(), 10);
            }
        }

        private void ContactListControl_Load(object sender, EventArgs e)
        {
            this.InitBuddyTree();
            this._user_StatusChanged(this.CurrentUser, new UserSatusChangedEventArgs(UserAccountStatus.None, this.CurrentUser.Status));
        }

        private void contactNodes_Add(Imps.Client.Core.Contact contact)
        {
            try
            {
                IEnumerator<SystemFixedContactGroup> enumerator3;
                if (contact == null)
                {
                    return;
                }
                if (this.m_buddytree_widget.searching)
                {
                    goto Label_015E;
                }
                switch (this._currentTreeGroupByType)
                {
                    case ContactTreeGroupByType.Group:
                        if (contact.BelongToGroups.get_Count() > 0)
                        {
                            using (IEnumerator<int> enumerator = contact.BelongToGroups.GetEnumerator())
                            {
                                while (enumerator.MoveNext())
                                {
                                    int num = enumerator.get_Current();
                                    Imps.Client.Core.ContactGroup group = this.ContactList.Groups[new int?(num)] as Imps.Client.Core.ContactGroup;
                                    try
                                    {
                                        this.m_buddytree_widget.add_buddy(group, contact, false);
                                        continue;
                                    }
                                    catch (Exception exception)
                                    {
                                        ClientLogger.WriteGeneral("ContactListControl.ContactNodes_Add", exception.ToString(), 10);
                                        continue;
                                    }
                                }
                                goto Label_0189;
                            }
                        }
                        this.m_buddytree_widget.add_buddy(contact, false);
                        goto Label_0189;

                    case ContactTreeGroupByType.Terminal:
                        goto Label_0115;

                    case ContactTreeGroupByType.Presence:
                    {
                        using (IEnumerator<SystemFixedContactGroup> enumerator2 = this.GroupsByPresence.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                SystemFixedContactGroup group2 = enumerator2.get_Current();
                                if (group2.UpdateBelong(contact))
                                {
                                    this.m_buddytree_widget.add_buddy(group2, contact, false);
                                }
                            }
                            goto Label_0189;
                        }
                    }
                    default:
                        goto Label_0189;
                }
            Label_0115:
                enumerator3 = this.GroupsByTerminal.GetEnumerator();
                try
                {
                    while (enumerator3.MoveNext())
                    {
                        SystemFixedContactGroup group3 = enumerator3.get_Current();
                        if (group3.UpdateBelong(contact))
                        {
                            this.m_buddytree_widget.add_buddy(group3, contact, false);
                        }
                    }
                    goto Label_0189;
                }
                finally
                {
                    if (enumerator3 != null)
                    {
                        enumerator3.Dispose();
                    }
                }
            Label_015E:
                if (contact.MatchSearch(this.tstbSearch.Text.Trim().ToLower()))
                {
                    this.m_buddytree_widget.add_buddy(contact, false);
                }
            Label_0189:
                if (this._isWizardVisible)
                {
                    this.setWizardUiOnNoneContact(false);
                }
            }
            catch (Exception exception2)
            {
                ClientLogger.WriteGeneral("ContactListControl", exception2.ToString(), 10);
            }
        }

        private void contactNodes_Delete(Imps.Client.Core.Contact contact)
        {
            this.m_buddytree_widget.remove_buddy(contact, true);
            bool? nullable = this._forceDisplayGroup;
            if (!nullable.GetValueOrDefault() && nullable.get_HasValue())
            {
                this.setWizardUiOnNoneContact(true);
            }
        }

        private void contactNodes_Update(Imps.Client.Core.Contact contact)
        {
            this.contactNodes_Delete(contact);
            this.contactNodes_Add(contact);
        }

        private void DisplayModeTrackBar_ValueChanged(object sender, EventArgs e)
        {
            try
            {
                int num = ((XTrackBar) sender).Value;
                this.m_buddytree_widget.DisplayMode = (BuddyTreeDisplayMode) num;
                this.CurrentUser.Configuration.UserSetting.MainWindowSetting.DisplayMode.ProposedValue = num;
                this.m_buddytree_widget.Focus();
            }
            catch
            {
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void handleContactInfoChanged_Tick(object sender, EventArgs e)
        {
            lock (this._contactInfoChangedCol)
            {
                for (int i = this._contactInfoChangedCol.get_Count() - 1; i >= 0; i--)
                {
                    Imps.Client.Core.Contact contact = this._contactInfoChangedCol.get_Item(i);
                    if (contact.Type == ContactType.Stranger)
                    {
                        this._contactInfoChangedCol.RemoveAt(i);
                    }
                    else
                    {
                        if (!this.m_buddytree_widget.searching)
                        {
                            this.m_buddytree_widget.update_contact_info(contact, ContactEventType.PropertiesChanged, false, false);
                        }
                        else
                        {
                            bool flag = this._searchResult.Contains(contact);
                            bool flag2 = contact.MatchSearch(this.tstbSearch.Text.Trim().ToLower());
                            if (flag)
                            {
                                if (flag2)
                                {
                                    this.m_buddytree_widget.update_contact_info(contact, ContactEventType.PropertiesChanged, false, false);
                                }
                                else
                                {
                                    this._searchResult.Remove(contact);
                                    this.bindSearchResult();
                                }
                            }
                            else if (flag2)
                            {
                                this._searchResult.Add(contact);
                                this.bindSearchResult();
                            }
                        }
                        this._contactInfoChangedCol.RemoveAt(i);
                    }
                }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -