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

📄 invitecontrol.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 4 页
字号:
                            this._selectedContacts.Add(tag);
                            if (!this.AddLabel(tag.DisplayName, tag))
                            {
                                break;
                            }
                            this.FormatOtherGroupBuddyNode(node, tag, true);
                        }
                    }
                    else if (!this._selectedContacts.Contains(tag))
                    {
                        (node2 as BuddySelectionBuddyNode).CheckState = CheckState.Unchecked;
                        if ((node as BuddySelectionGroupNode).CheckState == CheckState.Checked)
                        {
                            FormatGroupCheckState(node2 as BuddySelectionBuddyNode);
                            this._framework.UnifiedMessageBox.ShowWarning(this, string.Format(StringTable.Conversation.MsgSelectLimit, this._maxSelectedCount));
                        }
                        this.FormatOtherGroupBuddyNode(node2, tag, false);
                    }
                    continue;
                }
                if (this._selectedContacts.Contains(tag))
                {
                    this._selectedContacts.Remove(tag);
                }
                this.RemoveLable(tag);
                this.RemoveTreeNodeSelect(tag);
            }
        }

        private void CheckLabel(Label label)
        {
            label.ForeColor = Color.White;
            label.BackColor = Color.Black;
        }

        private void CheckNode(PaintTreeNode node)
        {
            try
            {
                if (node.Tag is Imps.Client.Core.ContactGroup)
                {
                    this.CheckGroupNode(node);
                }
                else if (node.Tag is Imps.Client.Core.Contact)
                {
                    this.CheckContactNode(node);
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

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

        private void flowPanlContacts_ControlsChanged(object sender, ControlEventArgs e)
        {
            if (this.SelectedContactsChanged != null)
            {
                this.SelectedContactsChanged(this, EventArgs.Empty);
            }
        }

        private void flowPanlContacts_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            if (e.get_KeyValue() == 0x2e)
            {
                this.RemoveCheckedLabels();
            }
        }

        private static void FormatGroupCheckState(PaintTreeNode node)
        {
            if (node.Parent != null)
            {
                bool flag = false;
                bool flag2 = true;
                foreach (TreeNode node2 in node.Parent.Nodes)
                {
                    if ((node2 as BuddySelectionBuddyNode).CheckState != CheckState.Checked)
                    {
                        flag2 = false;
                        continue;
                    }
                    flag = true;
                }
                if (flag2)
                {
                    (node.Parent as BuddySelectionGroupNode).CheckState = CheckState.Checked;
                }
                else if (flag)
                {
                    (node.Parent as BuddySelectionGroupNode).CheckState = CheckState.Indeterminate;
                }
                else
                {
                    (node.Parent as BuddySelectionGroupNode).CheckState = CheckState.Unchecked;
                }
            }
        }

        private void FormatOtherGroupBuddyNode(TreeNode node, Imps.Client.Core.Contact contact, bool check)
        {
            if (contact.BelongToGroups.get_Count() > 1)
            {
                for (int i = 0; i < this.treeContacts.Nodes.Count; i++)
                {
                    if (this.treeContacts.Nodes[i] != node)
                    {
                        if (this.treeContacts.Nodes[i] is BuddySelectionBuddyNode)
                        {
                            if (((this.treeContacts.Nodes[i] as BuddySelectionBuddyNode).Tag as Imps.Client.Core.Contact) == contact)
                            {
                                if (check)
                                {
                                    (this.treeContacts.Nodes[i] as BuddySelectionBuddyNode).CheckState = CheckState.Checked;
                                }
                                else
                                {
                                    (this.treeContacts.Nodes[i] as BuddySelectionBuddyNode).CheckState = CheckState.Unchecked;
                                }
                            }
                        }
                        else if (contact.BelongToGroups.Contains(((this.treeContacts.Nodes[i] as BuddySelectionGroupNode).Tag as Imps.Client.Core.ContactGroup).Id))
                        {
                            foreach (TreeNode node2 in this.treeContacts.Nodes[i].Nodes)
                            {
                                if (((node2 as BuddySelectionBuddyNode).Tag as Imps.Client.Core.Contact) != contact)
                                {
                                    continue;
                                }
                                if (check)
                                {
                                    (node2 as BuddySelectionBuddyNode).CheckState = CheckState.Checked;
                                }
                                else
                                {
                                    (node2 as BuddySelectionBuddyNode).CheckState = CheckState.Unchecked;
                                }
                                FormatGroupCheckState(node2 as PaintTreeNode);
                            }
                        }
                    }
                }
            }
        }

        private void FormatSelectInfo()
        {
            int num = this._selectedContacts.get_Count();
            this.lblSelectInfo.Text = string.Format(StringTable.Conversation.MsgInviteSelectedInfo, num, this._maxSelectedCount - num);
        }

        private List<Imps.Client.Core.Contact> GetAllowContacts(List<Imps.Client.Core.Contact> sourceList)
        {
            List<Imps.Client.Core.Contact> list = new List<Imps.Client.Core.Contact>();
            List<Imps.Client.Core.Contact>.Enumerator enumerator = sourceList.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    Imps.Client.Core.Contact contact = enumerator.get_Current();
                    if (this.IsContactCanShow(contact))
                    {
                        list.Add(contact);
                    }
                }
            }
            finally
            {
                enumerator.Dispose();
            }
            return list;
        }

        private Label GetLabelByContact(Imps.Client.Core.Contact contact)
        {
            for (int i = 0; i < this.flowPanlContacts.Controls.get_Count(); i++)
            {
                if ((this.flowPanlContacts.Controls[i].Tag as Imps.Client.Core.Contact) == contact)
                {
                    return (this.flowPanlContacts.Controls[i] as Label);
                }
            }
            return null;
        }

        private int GetLabelIndex(Label label)
        {
            for (int i = 0; i < this.flowPanlContacts.Controls.get_Count(); i++)
            {
                if (this.flowPanlContacts.Controls[i] == label)
                {
                    return i;
                }
            }
            return -1;
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            this.menuDelete = new ToolStripMenuItem();
            this.menuOperation = new menu_widget(this.components);
            this.xSplitContainer = new XSplitContainer();
            this.pnlOnlyForBorderShit = new Panel();
            this.lblNoneContacts = new Label();
            this.treeContacts = new BuddySelectionTree();
            this.toolbarSearch = new BListControlToolbar();
            this.lblMessage = new Label();
            this.panel1 = new Panel();
            this.panel2 = new Panel();
            this.flowPanlContacts = new FlowLayoutPanel();
            this.lbSpace = new Label();
            this.lblSelectInfo = new Label();
            this.menuOperation.SuspendLayout();
            this.xSplitContainer.get_Panel1().SuspendLayout();
            this.xSplitContainer.get_Panel2().SuspendLayout();
            this.xSplitContainer.SuspendLayout();
            this.pnlOnlyForBorderShit.SuspendLayout();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            base.SuspendLayout();
            this.menuDelete.set_Name("menuDelete");
            this.menuDelete.set_Size(new Size(0x62, 0x16));
            this.menuDelete.set_Text("删除");
            this.menuDelete.add_Click(new EventHandler(this.menuDelete_Click));
            this.menuOperation.get_Items().AddRange(new ToolStripItem[] { this.menuDelete });
            this.menuOperation.Name = "menuOperation";
            this.menuOperation.Size = new Size(0x63, 0x1a);
            this.menuOperation.UseMnemonic = true;
            this.xSplitContainer.BackColor = Color.Transparent;
            this.xSplitContainer.set_Dock(DockStyle.Fill);
            this.xSplitContainer.Location = new System.Drawing.Point(0, 0);
            this.xSplitContainer.Name = "xSplitContainer";
            this.xSplitContainer.set_Orientation(Orientation.Horizontal);
            this.xSplitContainer.get_Panel1().BackColor = Color.Transparent;
            this.xSplitContainer.get_Panel1().Controls.Add(this.pnlOnlyForBorderShit);
            this.xSplitContainer.get_Panel1().Controls.Add(this.toolbarSearch);
            this.xSplitContainer.get_Panel1().Controls.Add(this.lblMessage);
            this.xSplitContainer.get_Panel1().RightToLeft = RightToLeft.No;
            this.xSplitContainer.set_Panel1MinSize(0x7d);
            this.xSplitContainer.get_Panel2().BackColor = Color.Transparent;
            this.xSplitContainer.get_Panel2().Controls.Add(this.panel1);
            this.xSplitContainer.get_Panel2().Controls.Add(this.lbSpace);
            this.xSplitContainer.get_Panel2().Controls.Add(this.lblSelectInfo);
            this.xSplitContainer.get_Panel2().RightToLeft = RightToLeft.No;
            this.xSplitContainer.set_Panel2MinSize(0x51);
            this.xSplitContainer.Size = new Size(0x10d, 0x17e);
            this.xSplitContainer.set_SplitterDistance(0x110);
            this.xSplitContainer.TabIndex = 5;
            this.pnlOnlyForBorderShit.BackColor = Color.FromArgb(0xca, 0xd4, 0xde);
            this.pnlOnlyForBorderShit.Controls.Add(this.lblNoneContacts);
            this.pnlOnlyForBorderShit.Controls.Add(this.treeContacts);
            this.pnlOnlyForBorderShit.Dock = DockStyle.Fill;
            this.pnlOnlyForBorderShit.Location = new System.Drawing.Point(0, 0x3f);
            this.pnlOnlyForBorderShit.Name = "pnlOnlyForBorderShit";
            this.pnlOnlyForBorderShit.set_Padding(new Padding(1, 0, 1, 1));
            this.pnlOnlyForBorderShit.Size = new Size(0x10d, 0xd1);
            this.pnlOnlyForBorderShit.TabIndex = 5;
            this.lblNoneContacts.set_AutoSize(true);
            this.lblNoneContacts.BackColor = Color.White;
            this.lblNoneContacts.Location = new System.Drawing.Point(4, 6);
            this.lblNoneContacts.Name = "lblNoneContacts";
            this.lblNoneContacts.Size = new Size(0x7d, 12);
            this.lblNoneContacts.TabIndex = 2;
            this.lblNoneContacts.Text = "没有符合您条件的好友";
            this.lblNoneContacts.Visible = false;
            this.treeContacts.BorderStyle = BorderStyle.None;
            this.treeContacts.ContactShowMode = ShowMode.SingleRow;
            this.treeContacts.Dock = DockStyle.Fill;
            this.treeContacts.FullRowSelect = true;
            this.treeContacts.HideSelection = false;
            this.treeContacts.Indent = 20;
            this.treeContacts.ItemHeight = 20;
            this.treeContacts.Location = new System.Drawing.Point(1, 0);
            this.treeContacts.Name = "treeContacts";
            this.treeContacts.PaintSelected = true;
            this.treeContacts.SelectBorderColor = Color.FromArgb(0x83, 150, 0xc3);
            this.treeContacts.SelectedNode = null;
            this.treeContacts.SelectionColor = Color.BlueViolet;
            this.treeContacts.ShowPlusMinus = false;
            this.treeContacts.Size = new Size(0x10b, 0xd0);
            this.treeContacts.Sorted = true;
            this.treeContacts.TabIndex = 1;
            this.toolbarSearch.BackColor = Color.FromArgb(0xca, 0xd4, 0xde);
            this.toolbarSearch.Dock = DockStyle.Top;
            this.toolbarSearch.DropDownMenu = null;
            this.toolbarSearch.Location = new System.Drawing.Point(0, 0x2a);
            this.toolbarSearch.Name = "toolbarSearch";
            this.toolbarSearch.ShowDisplayModeBar = false;
            this.toolbarSearch.SimpleMode = true;
            this.toolbarSearch.Size = new Size(0x10d, 0x15);
            this.toolbarSearch.TabIndex = 0;
            this.toolbarSearch.TipText = "请输入昵称、姓名、手机号、飞信号等查找好友";
            this.toolbarSearch.TipTextClear = "清除输入内容";
            this.toolbarSearch.TipTextMagnifier = "请输入昵称、姓名、手机号、飞信号等查找好友";
            this.toolbarSearch.TipTextMenu = "请输入昵称、姓名、手机号、飞信号等查找好友";
            this.lblMessage.Dock = DockStyle.Top;
            this.lblMessage.Location = new System.Drawing.Point(0, 0);
            this.lblMessage.Name = "lblMessage";
            this.lblMessage.set_Padding(new Padding(1));
            this.lblMessage.Size = new Size(0x10d, 0x2a);
            this.lblMessage.TabIndex = 4;
            this.lblMessage.Text = "Message";
            this.panel1.BackColor = Color.FromArgb(0xca, 0xd4, 0xde);
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Dock = DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 0x15);
            this.panel1.Name = "panel1";
            this.panel1.set_Padding(new Padding(1));
            this.panel1.Size = new Size(0x10d, 0x55);
            this.panel1.TabIndex = 3;
            this.panel2.BackColor = Color.White;
            this.panel2.Controls.Add(this.flowPanlContacts);
            this.panel2.Dock = DockStyle.Fill;
            this.panel2.Location = new System.Drawing.Point(1, 1);
            this.panel2.Name = "panel2";
            this.panel2.set_Padding(new Padding(3, 3, 0, 0));
            this.panel2.Size = new Size(0x10b, 0x53);
            this.panel2.TabIndex = 0;
            this.flowPanlContacts.AutoScroll = true;
            this.flowPanlContacts.BackColor = Color.White;

⌨️ 快捷键说明

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