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

📄 contactlistcontrol.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 5 页
字号:
            ToolStripSeparator separator3 = new ToolStripSeparator();
            separator2.set_Enabled(false);
            separator3.set_Enabled(false);
            this.mw_DisplayMenu.get_Items().AddRange(new ToolStripItem[] { this.mr_d_Group, this.mr_d_Terminal, this.mr_d_Presence, separator2, this.mr_d_DetailMouseOver });
            this._toolbar.DropDownMenu = this.mw_DisplayMenu;
        }

        private void InitializeLinkLabel()
        {
            if (this.CurrentUser.Status == UserAccountStatus.OfflineLogon)
            {
                this.lblAddBuddy.Enabled = false;
                this.lblMatch.Enabled = false;
                this.lblImport.Enabled = false;
            }
            else
            {
                this.lblAddBuddy.Enabled = true;
                this.lblMatch.Enabled = true;
                this.lblImport.Enabled = true;
            }
        }

        private void InitializeWndlessComponent()
        {
            this.lblId = new WndlessLabel();
            this.lblId.AutoSize = true;
            this.lblId.Location = new System.Drawing.Point(this.m_buddytree_widget.Location.X + 10, this.m_buddytree_widget.Location.Y + 8);
            this.lblId.Text = StringTable.ContactTree.FoundNone;
            this.lblId.BackColor = this.m_buddytree_widget.BackColor;
            this.lblId.Visible = true;
            this._wndlessCtls = new WndlessControlCollection(this);
            this.set_DoubleBuffered(true);
            this._wndlessCtls.Add(this.lblId);
        }

        private void InitInitPanel()
        {
            this.pbInput.Image = ImpsIcons.Import;
            this.pbMatch.Image = ImpsIcons.Match;
            this.pbAddBuddy.Image = ImpsIcons.AddBuddy_24;
        }

        private void InitToolbar()
        {
            this._toolbar = (BListControlToolbar) this._iFrameworkWnd.ContactManager.ToolbarControl;
            this.tstbSearch = this._toolbar.SearchTextBox;
            this._toolbar.SearchTextBox.KeyDown += new KeyEventHandler(this.tstbSearch_KeyDown);
            this._toolbar.SearchTextBox.TextChanged += new EventHandler(this.tstbSearch_TextChanged);
            this._toolbar.DisplayModeTrackBar.ValueChanged += new EventHandler(this.DisplayModeTrackBar_ValueChanged);
            this.tstbSearch.MaxLength = 0x40;
        }

        private void lblAddBuddy_Click(object sender, EventArgs e)
        {
            this._iFrameworkWnd.ContactManager.ShowAddBuddyWindow(this._iFrameworkWnd.MainWindow, null, null, string.Empty, null, ContactType.ImpsContact);
        }

        private void lblImput_Click(object sender, EventArgs e)
        {
            this._iFrameworkWnd.ImportExportManager.Import();
        }

        private void lblMatch_Click(object sender, EventArgs e)
        {
            this._iFrameworkWnd.ContactManager.ShowMatchWindow();
        }

        private void loadGroupCollapse()
        {
            string treeExpandStatus = this._iFrameworkWnd.AccountManager.CurrentUser.Configuration.UserSetting.MainWindowSetting.TreeExpandStatus;
            if (treeExpandStatus.Length != 0)
            {
                foreach (string text2 in treeExpandStatus.Split(new char[] { ';' }))
                {
                    if (text2.Length != 0)
                    {
                        int num;
                        int.TryParse(text2, ref num);
                        if (this._currentTreeGroupByType == ContactTreeGroupByType.Group)
                        {
                            Imps.Client.Core.ContactGroup group = this.ContactList.Groups[new int?(num)] as Imps.Client.Core.ContactGroup;
                            if (group != null)
                            {
                                this.m_buddytree_widget.expand_group(group, false, false);
                            }
                        }
                        else if (this._currentTreeGroupByType == ContactTreeGroupByType.Presence)
                        {
                            SystemFixedContactGroup group2 = this.GroupsByPresence[new int?(num)];
                            if (group2 != null)
                            {
                                this.m_buddytree_widget.expand_group(group2, false, false);
                            }
                        }
                        else if (this._currentTreeGroupByType == ContactTreeGroupByType.Terminal)
                        {
                            SystemFixedContactGroup group3 = this.GroupsByTerminal[new int?(num)];
                            if (group3 != null)
                            {
                                this.m_buddytree_widget.expand_group(group3, false, false);
                            }
                        }
                    }
                }
            }
        }

        private void mr_d_DetailMouseOver_Click(object sender, EventArgs e)
        {
            try
            {
                this.changeTreeShowDetailTip(!this.m_buddytree_widget.show_detailtip, false);
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void mr_d_Group_Click(object sender, EventArgs e)
        {
            try
            {
                this.changeTreeGroupByType(ContactTreeGroupByType.Group, false);
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void mr_d_Presence_Click(object sender, EventArgs e)
        {
            try
            {
                this.changeTreeGroupByType(ContactTreeGroupByType.Presence, false);
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void mr_d_Ter_Click(object sender, EventArgs e)
        {
            try
            {
                this.changeTreeGroupByType(ContactTreeGroupByType.Terminal, false);
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_drop_contact_into_group(object sender, ContactGroupBase group, int? srcGroupId, Imps.Client.Core.Contact contact, bool fMove)
        {
            if (group == null)
            {
                throw new ArgumentNullException("group");
            }
            if (contact == null)
            {
                throw new ArgumentNullException("contact");
            }
            AsyncBizOperation op = new AsyncBizOperation();
            op.IsImpsErrorHandled = true;
            if (ContactType.ChatFriend == contact.Type)
            {
                string mobileNo = string.IsNullOrEmpty(contact.PersonalInfo.MobileNo) ? contact.PersonalInfo.MobileNoUserSet : contact.PersonalInfo.MobileNo;
                this._iFrameworkWnd.ContactManager.ShowAddBuddyWindow(this._iFrameworkWnd.MainWindow, mobileNo, new long?(contact.Uri.Sid), string.Empty, new int?(group.Id), ContactType.ImpsContact);
            }
            else if (fMove)
            {
                Imps.Client.Core.ContactGroup.AsyncMoveContactTo(this.CurrentUser, contact.Uri, srcGroupId, new int?(group.Id), op);
            }
            else
            {
                Imps.Client.Core.ContactGroup.AsyncCopyContactTo(this.CurrentUser, contact.Uri, srcGroupId, new int?(group.Id), op);
            }
        }

        private void on_drop_contacts_into_group(object sender, Dictionary<IicUri, ArrayList> dic, bool fMove)
        {
            if ((dic != null) && (dic.get_Count() == 0))
            {
            }
        }

        private void on_group_expand_changed(object sender, object group, bool fExpanded)
        {
            int? nullable = null;
            if (group is ContactGroupBase)
            {
                nullable = new int?((group as ContactGroupBase).Id);
            }
            else if (group is SystemFixedContactGroup)
            {
                nullable = new int?((group as SystemFixedContactGroup).Id);
            }
            if (nullable.get_HasValue())
            {
                if (fExpanded)
                {
                    if (this._collapsedGroups.Contains(nullable.ToString()))
                    {
                        this._collapsedGroups.Remove(nullable.ToString());
                    }
                }
                else if (!this._collapsedGroups.Contains(nullable.ToString()))
                {
                    this._collapsedGroups.Add(nullable.ToString());
                }
                string text = string.Join(";", (string[]) this._collapsedGroups.ToArray(typeof(string)));
                this.CurrentUser.Configuration.UserSetting.MainWindowSetting.TreeExpandStatus = text;
            }
        }

        private void on_showdetail_change_cmd(object sender, bool command)
        {
        }

        private void on_showdetailtip_change_cmd(object sender, bool command)
        {
            this.changeTreeShowDetailTip(command, false);
        }

        private void on_sortstyle_change_cmd(object sender, buddytree_widget.SORTSTYLE newStyle)
        {
            switch (newStyle)
            {
                case buddytree_widget.SORTSTYLE.SORT_BY_GROUP:
                    this.changeTreeGroupByType(ContactTreeGroupByType.Group, false);
                    return;

                case buddytree_widget.SORTSTYLE.SORT_BY_DEVICE:
                    this.changeTreeGroupByType(ContactTreeGroupByType.Terminal, false);
                    return;

                case buddytree_widget.SORTSTYLE.SORT_BY_STATE:
                    this.changeTreeGroupByType(ContactTreeGroupByType.Presence, false);
                    return;
            }
            throw new Exception("Unsupported sort style");
        }

        private void refreshContactList()
        {
            try
            {
                IEnumerator<SystemFixedContactGroup> enumerator5;
                if (((this.CurrentUser.Status != UserAccountStatus.Logon) && (this.CurrentUser.Status != UserAccountStatus.OfflineLogon)) || (this.ContactList == null))
                {
                    return;
                }
                if (this.ContactList.Contacts.Count <= 0)
                {
                    bool? nullable = this._forceDisplayGroup;
                    if (!nullable.GetValueOrDefault() || !nullable.get_HasValue())
                    {
                        this.setWizardUiOnNoneContact(true);
                        goto Label_0072;
                    }
                }
                this.setWizardUiOnNoneContact(false);
            Label_0072:
                this.m_buddytree_widget.remove_allitems(false);
                switch (this._currentTreeGroupByType)
                {
                    case ContactTreeGroupByType.Group:
                        lock (this.ContactList.Groups.SyncRoot)
                        {
                            using (IEnumerator<ContactGroupBase> enumerator = this.ContactList.Groups.GetEnumerator())
                            {
                                while (enumerator.MoveNext())
                                {
                                    Imps.Client.Core.ContactGroup group = (Imps.Client.Core.ContactGroup) enumerator.get_Current();

⌨️ 快捷键说明

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