messagehistoryfrom.cs

来自「破解的飞信源代码」· CS 代码 · 共 1,211 行 · 第 1/5 页

CS
1,211
字号
            this.pProgress.Location = new System.Drawing.Point((base.Width - 200) / 2, (base.Height - 0x26) / 2);
            this.splitContainer.get_Panel1().ResumeLayout(false);
            this.splitContainer.get_Panel2().ResumeLayout(false);
            this.splitContainer.get_Panel2().PerformLayout();
            this.splitContainer.ResumeLayout(false);
            this.pPlayerNavigation.ResumeLayout(false);
            this.pMessage.ResumeLayout(false);
            this.pMessageView.ResumeLayout(false);
            this.operatePanel.ResumeLayout(false);
            this.pProgress.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void AutoMessageListSize()
        {
            int num = this.splitContainer.get_Panel2().get_Width();
            int num2 = this.splitContainer.get_Panel2().get_Height();
            if (this.MessageCount != 0)
            {
                this.pMessageView.Enabled = true;
                this.pMessageView.Location = new System.Drawing.Point(3, 0x4c);
                if (!_hiddeDetail)
                {
                    this.pMessageView.Size = new Size(num - 6, num2 - 0xe5);
                    this.btnHiddeDetail.Image = ImpsResources.GetImage("Images.downbtn.png");
                }
                else
                {
                    this.pMessageView.Size = new Size(num - 6, num2 - 0x4f);
                    this.btnHiddeDetail.Image = ImpsResources.GetImage("Images.upbtn.png");
                }
                this.dvMessageView.Location = new System.Drawing.Point(1, 1);
                this.dvMessageView.Size = new Size(this.pMessageView.Width - 2, this.pMessageView.Height - 0x11);
                this.btnHiddeDetail.Location = new System.Drawing.Point(0, this.pMessageView.Height - 15);
                this.btnHiddeDetail.Size = new Size(this.pMessageView.Width, 15);
                this.btnHiddeDetail.Visible = true;
                this.pictureBox.Location = new System.Drawing.Point(this.pMessageView.Width - 0xb6, this.pMessageView.Height - 0xa2);
                if (!_hiddeDetail)
                {
                    this.lDateTime.Location = new System.Drawing.Point(3, num2 - 0x91);
                    this.lPlayer.Location = new System.Drawing.Point(210, num2 - 0x91);
                    this.lPlayer.Size = new Size(100, 14);
                    this.lReceivers.Location = new System.Drawing.Point(310, num2 - 0x91);
                    this.lReceivers.Size = new Size((num - 0xd5) - 100, 14);
                    this.pMessage.Location = new System.Drawing.Point(3, num2 - 0x7c);
                    this.pMessage.Size = new Size(num - 6, 0x79);
                    this.tbMessage.Location = new System.Drawing.Point(1, 1);
                    this.tbMessage.Size = new Size(this.pMessage.Width - 2, this.pMessage.Height - 2);
                    this.pMessage.Visible = true;
                }
                else
                {
                    this.pMessage.Visible = false;
                }
                this.pictureBox.Visible = false;
            }
            else
            {
                this.pMessageView.Location = new System.Drawing.Point(3, 0x4c);
                this.pMessageView.Size = new Size(num - 6, num2 - 0x4f);
                this.pMessageView.Enabled = false;
                this.dvMessageView.Location = new System.Drawing.Point(1, 1);
                this.dvMessageView.Size = new Size(this.pMessageView.Width - 2, this.pMessageView.Height - 2);
                this.pictureBox.Location = new System.Drawing.Point(this.pMessageView.Width - 0xb6, this.pMessageView.Height - 0xa2);
                this.pictureBox.Visible = true;
                this.pMessage.Visible = false;
                this.btnHiddeDetail.Visible = false;
            }
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            TreeNode selectNode = this.playerNavigation.SelectedNode;
            this.DeleteHistory(selectNode);
        }

        private void btnHiddeDetail_Click(object sender, EventArgs e)
        {
            _hiddeDetail = !_hiddeDetail;
            this.AutoMessageListSize();
        }

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            this.ShowMessage(this.playerNavigation.SelectedNode, 0);
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            this.ShowMessage(this.playerNavigation.SelectedNode, 0);
        }

        private void cmCopy_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.get_ClickedItem() == this.miCopy)
            {
                this._rtfManager.DoCopy();
            }
        }

        private void cmTree_Closed(object sender, ToolStripDropDownClosedEventArgs e)
        {
            if (this._newSelectNode != null)
            {
                this._newSelectNode.ForeColor = this.playerNavigation.ForeColor;
                this._newSelectNode.BackColor = this.playerNavigation.BackColor;
            }
        }

        private void cmTree_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.get_ClickedItem() == this.miOpen)
            {
                this.playerNavigation.SelectedNode = this._newSelectNode;
            }
            if (e.get_ClickedItem() == this.miDelete)
            {
                this.DeleteHistory(this._newSelectNode);
            }
            if (e.get_ClickedItem() == this.miRefresh)
            {
                if (this.playerNavigation.SelectedNode == this._newSelectNode)
                {
                    this.btnRefresh_Click(sender, e);
                }
                else
                {
                    this.playerNavigation.SelectedNode = this._newSelectNode;
                }
            }
            if (e.get_ClickedItem() == this.miOperation)
            {
                Player player = this._newSelectNode.Tag as Player;
                if (player != null)
                {
                    switch (player.Type)
                    {
                        case PlayerType.Contact:
                            this._framework.ConversationManager.StartConversation(this, ConversationOperation.ImChat, new string[] { player.Uri });
                            return;

                        case PlayerType.User:
                            this._framework.ConversationManager.StartConversation(this, ConversationOperation.SmsChat, new string[] { player.Uri });
                            return;

                        case PlayerType.Group:
                        {
                            PersonalGroup group = this._framework.AccountManager.CurrentUser.PersonalGroups[player.Uri];
                            if (group != null)
                            {
                                this._framework.PersonalGroupManager.StartGroupConversation(this, group, ConversationOperation.ImChat);
                                return;
                            }
                            this._framework.UnifiedMessageBox.ShowError("您不是该群成员,无法发送群消息。");
                            return;
                        }
                        default:
                            return;
                    }
                }
            }
        }

        private void cmTree_Opening(object sender, CancelEventArgs e)
        {
            if (this._newSelectNode != null)
            {
                this._newSelectNode.ForeColor = this.playerNavigation.BackColor;
                this._newSelectNode.BackColor = this.playerNavigation.ForeColor;
            }
        }

        private void ContactList_ContactTypeChanged(object sender, ContactTypeChangedEventArgs e)
        {
            if (e.NewContactInstance.Uri.Raw != e.OldContactInstance.Uri.Raw)
            {
                foreach (TreeNode node in this.playerNavigation.Nodes)
                {
                    TreeNode node2 = this.FindPlayer(node, e.OldContactInstance.Uri.Raw);
                    if ((node2 != null) && (node2.Tag is Player))
                    {
                        Player player = node2.Tag as Player;
                        node2.Tag = new Player(e.NewContactInstance.Uri.Raw, player.Name, player.Type, player.Status);
                    }
                }
            }
        }

        private void CurrentUser_StatusChanged(object sender, UserSatusChangedEventArgs e)
        {
            if (e.NewStatus != UserAccountStatus.Logon)
            {
                base.Close();
            }
        }

        private void DeleteHistory(TreeNode selectNode)
        {
            if ((selectNode != null) && (selectNode.Tag is Player))
            {
                Player selectPlayer = selectNode.Tag as Player;
                if ((selectPlayer != null) && (selectPlayer.Type != PlayerType.System))
                {
                    using (DeleteHistoryForm form = new DeleteHistoryForm(this._framework, selectPlayer))
                    {
                        form.ShowDialog(this);
                    }
                }
            }
        }

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

        private void dvMessageView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (!string.IsNullOrEmpty(this.tbSearchString.SearchTextBox.Text) && (this.dvMessageView.get_SelectedRows().Count > 0))
            {
                int msgCount;
                Player selectPlayer;
                MessageView message = this.sourceManager.get_Item(this.dvMessageView.get_SelectedRows().get_Item(0).get_Index()) as MessageView;
                IList<MessageView> messageList = this._messageManager.LoadMessages<MessageView>(message, out selectPlayer, out this._currentPage, out msgCount);
                this.SelectPlayer(selectPlayer);
                this.InitializeMessageView(selectPlayer.Type, MessageType.All);
                this.ShowMessage(messageList, message);
                this.MessageCount = msgCount;
                this.tbSearchString.SearchTextBox.Text = string.Empty;
            }
        }

        private void dvMessageView_SelectionChanged(object sender, EventArgs e)
        {
            if (this.dvMessageView.get_SelectedRows().Count > 0)
            {
                this.ShowMessage(this.sourceManager.get_Item(this.dvMessageView.get_SelectedRows().get_Item(0).get_Index()) as MessageView);
            }
        }

⌨️ 快捷键说明

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