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

📄 conversationwindow.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 5 页
字号:
                    {
                        graphics2.Clear(Color.White);
                        graphics2.DrawImage(defaultPortrait, 1, 1);
                    }
                    image2 = new AmigoImage(image);
                }
                string text = string.Format("{0}({1})", sc.FileName, StringHelper.GetFileSize(sc.FileSize));
                this._historyChatManager.SelectionIdent = 0;
                if (sc is DownLoadShareContent)
                {
                    DownLoadShareContent content = sc as DownLoadShareContent;
                    this.AppendMessage(new CommonMessage(null, string.Format(StringTable.Conversation.MsgSendShareContentInfo, ConvertString(content.From.DisplayName))));
                    this._historyChatManager.AppendProgressbar(newKey, text, image2, sc.FileName ?? string.Empty);
                    this._historyChatManager.AppendCRLF();
                    this.InserShareContentLinkButton(ShareContentLinkValue.Accept.ToString(), (sc.LastTimeCompleteSize == 0) ? StringTable.Conversation.BtnAccept : "续传", Keys.A, sc);
                    this.InserShareContentLinkButton(ShareContentLinkValue.SaveAs.ToString(), StringTable.Conversation.BtnSaveAs, Keys.T, sc);
                    this.InserShareContentLinkButton(ShareContentLinkValue.Decline.ToString(), StringTable.Conversation.BtnRefuse, Keys.D, sc);
                    this._historyChatManager.AppendCRLF();
                }
                else
                {
                    this.AppendMessage(new CommonMessage(null, string.Format(StringTable.Conversation.MsgSendShareContentInfo, ConvertString(this.CurrentUser.Nickname))));
                    this._historyChatManager.AppendProgressbar(newKey, text, image2, sc.FileName);
                    this._historyChatManager.AppendCRLF();
                    this.InserShareContentLinkButton(ShareContentLinkValue.Cancel.ToString(), StringTable.Conversation.BtnCancel, Keys.C, sc);
                    this._historyChatManager.AppendCRLF();
                }
                this._historyChatManager.ScrollToEnd();
            }
        }

        private void CalculateMultiLstHeight()
        {
            if ((this._lstContacts != null) && (this._buddy_list_drawer != null))
            {
                int num = (this.scMain.Height - this.picOwner.Height) - this._buddy_list_drawer.itemheight;
                if (num > 0)
                {
                    if ((this._lstContacts.Items.Count * this._buddy_list_drawer.itemheight) > num)
                    {
                        this._lstContacts.Parent.Height = num;
                    }
                    else
                    {
                        this._lstContacts.Parent.Height = ((this._lstContacts.Items.Count * this._buddy_list_drawer.itemheight) + this._lstContacts.Parent.get_Padding().get_Top()) + this._lstContacts.Parent.get_Padding().get_Bottom();
                    }
                }
            }
        }

        private void CaptureScreeAfterMinForm()
        {
            base.Opacity = 0;
            base.RemoveCaption();
            base.WindowState = FormWindowState.Minimized;
            this.CaptureScreen();
        }

        private void CaptureScreen()
        {
            Application.Idle += new EventHandler(this.Application_Idle);
        }

        private void CaptureScreenAfterIdle()
        {
            try
            {
                if (CaptureHelper.CaptureImage())
                {
                    Image capturedImage = CaptureHelper.CapturedImage;
                    if (capturedImage != null)
                    {
                        string text = string.Format("pic_{0}.png", DateTime.Now.ToString("MMddHHmmss"));
                        string path = Path.Combine(this.CurrentUser.Configuration.UserSetting.ConversationSetting.DefaultShareContentSavePath, "CaptureScreen");
                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }
                        string text3 = Path.Combine(path, text);
                        if (File.Exists(text3))
                        {
                            File.Delete(text3);
                        }
                        capturedImage.Save(text3, ImageFormat.Png);
                        this.SendFile(text3);
                    }
                }
            }
            catch (Exception exception)
            {
                this.HandleException(exception);
            }
        }

        private void CloseCurrentConversation()
        {
            try
            {
                this._curConversation.AddDialog -= new EventHandler<DialogEventArgs>(this, (IntPtr) this.Dialogs_AddDialog);
                this._curConversation.Closed -= new EventHandler(this._curConversation_Closed);
            }
            catch (Exception exception)
            {
                this.HandleException(exception);
            }
            finally
            {
                this._curConversation = null;
            }
        }

        private void contact_IsBlockChanged(object sender, BlockEventArgs e)
        {
            Imps.Client.Core.Contact contact = sender as Imps.Client.Core.Contact;
            if (this.IsMultiConversation)
            {
                foreach (ToolStripMenuItem item in this.menuBlockUsers.get_Items())
                {
                    if (item.get_Tag() == contact)
                    {
                        item.set_Checked(contact.IsBlocked);
                    }
                }
                foreach (ToolStripMenuItem item2 in this.tsOperationBlock.get_DropDown().get_Items())
                {
                    if (item2.get_Tag() == contact)
                    {
                        item2.set_Checked(contact.IsBlocked);
                    }
                }
                this.InitTooltipInfo();
            }
            else
            {
                if ((contact.IsBlocked && (this.CurrentConversation != null)) && (this.CurrentConversation.CurrentDialog != null))
                {
                    try
                    {
                        for (int i = this.CurrentConversation.Dialogs.Count - 1; i >= 0; i--)
                        {
                            Dialog dialog = this.CurrentConversation.Dialogs[i];
                            if ((dialog.Participants.Count == 1) && (dialog.Participants[0].Contact == contact))
                            {
                                dialog.ShareContents.Clear();
                            }
                        }
                    }
                    catch (Exception exception)
                    {
                        ClientLogger.WriteException(exception);
                    }
                }
                this.tsMain.SuspendLayout();
                this.tsInvite.set_Enabled(this.CanInviteNewContact);
                this.InitControlEnable(contact);
                this.InitBlockControl(contact);
                this.InitTooltipInfo();
                if (contact is Imps.Client.Core.MobileBuddy)
                {
                    this.SendSMS = true;
                }
                this.tsMain.ResumeLayout();
                this.InitSMSInfo();
            }
        }

        private void contact_PersonalInfo_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
        {
            try
            {
                Imps.Client.Core.Contact owner = (sender as Imps.Client.Core.ContactInfo).Owner;
                if (!this.IsMultiConversation)
                {
                    this.contactToolTip.set_Tag(owner.DisplayName);
                    if (e.ContainsProperty("Provision"))
                    {
                        this.InitControls(owner);
                    }
                    if (e.ContainsProperty("Portrait"))
                    {
                        ControlHelper.FadeinImage(this.picContact, owner.PersonalInfo.Portrait);
                    }
                    if (e.ContainsAnyOfProperties(new string[] { "MobileNo" }))
                    {
                        this.InitPicContactInfo(owner);
                    }
                }
                else
                {
                    buddylistbox_item<string> listItemByContact = this.GetListItemByContact(owner);
                    if (listItemByContact != null)
                    {
                        listItemByContact.name = owner.DisplayName;
                        if (e.ContainsProperty("Portrait"))
                        {
                            listItemByContact.image = owner.PersonalInfo.Portrait;
                        }
                    }
                    for (int i = 0; i < this.menuBlockUsers.get_Items().get_Count(); i++)
                    {
                        if ((this.menuBlockUsers.get_Items().get_Item(i).get_Tag() as Imps.Client.Core.Contact) == owner)
                        {
                            this.menuBlockUsers.get_Items().get_Item(i).set_Text(owner.DisplayName);
                        }
                    }
                    for (int j = 0; j < this.tsOperationBlock.get_DropDownItems().get_Count(); j++)
                    {
                        if ((this.tsOperationBlock.get_DropDownItems().get_Item(j).get_Tag() as Imps.Client.Core.Contact) == owner)
                        {
                            this.tsOperationBlock.get_DropDownItems().get_Item(j).set_Text(owner.DisplayName);
                        }
                    }
                    for (int k = 0; k < this.tsOperationContactInfo.get_DropDownItems().get_Count(); k++)
                    {
                        if ((this.tsOperationContactInfo.get_DropDownItems().get_Item(k).get_Tag() as Imps.Client.Core.Contact) == owner)
                        {
                            this.tsOperationContactInfo.get_DropDownItems().get_Item(k).set_Text(owner.DisplayName);
                        }
                    }
                    for (int m = 0; m < this.tsOperationMessageHistory.get_DropDownItems().get_Count(); m++)
                    {
                        if ((this.tsOperationMessageHistory.get_DropDownItems().get_Item(m).get_Tag() as Imps.Client.Core.Contact) == owner)
                        {
                            this.tsOperationMessageHistory.get_DropDownItems().get_Item(m).set_Text(owner.DisplayName);
                        }
                    }
                    for (int n = 0; n < this.tsHistory.get_DropDownItems().get_Count(); n++)
                    {
                        if ((this.tsHistory.get_DropDownItems().get_Item(n).get_Tag() as Imps.Client.Core.Contact) == owner)
                        {
                            this.tsHistory.get_DropDownItems().get_Item(n).set_Text(owner.DisplayName);
                        }
                    }
                }
                this.InitTooltipInfo();
                this.InitFormCaptionAndText();
            }
            catch (Exception exception)
            {
                this.HandleException(exception);
            }
        }

        private void contact_Presence_PropertiesChanged(object sender, PropertiesChangedEventArgs ev)
        {
            try
            {
                Imps.Client.Core.Contact owner = (sender as ContactPresence).Owner;
                if (this.IsMultiConversation)
                {
                    if (ev.ContainsAnyOfProperties(new string[] { "value", "desc" }))
                    {
                        this.InitTooltipInfo();
                    }
                    if (ev.ContainsAnyOfProperties(new string[] { "MoodPhrase" }))
                    {
                        buddylistbox_item<string> listItemByContact = this.GetListItemByContact(owner);
                        if (listItemByContact != null)
                        {
                            listItemByContact.personal_message = owner.Presence.MoodPhrase;
                        }
                    }
                }
                else
                {
                    this.InitControlEnable(owner);
                    if (ev.ContainsAnyOfProperties(new string[] { "value", "desc" }))
                    {
                        this.InitTooltipInfo();
                        this.InitInputBoxMaxLength(owner);
                        this.tsIVR.set_Enabled(owner.EnableIvr);
                        if (ev.ContainsAllOfProperties(new string[] { "value" }))
                        {
                            bool canInviteNewContact = this.CanInviteNewContact;
                            if (this.tsInvite.get_Enabled() != canInviteNewContact)
                            {
                                this.tsInvite.set_Enabled(canInviteNewContact);
                            }
                        }
                        if ((MainPresenceHelper.IsOnline(owner.Presence.MainPresence) && (this.CurrentConversation != null)) && ((this.CurrentConversation.CurrentDialog != null) && (this.CurrentConversation.CurrentDialog.Status == DialogStatus.None)))
                        {
                            this.CurrentConversation.CurrentDialog.Status = DialogStatus.Inviting;
                            this.CurrentConversation.CurrentDialog.AsyncSendInvite();
                        }
                    }
                    if (ev.ContainsAllOfProperties(new string[] { "MoodPhrase" }))
                    {
                        this.InitFormCaptionAndText();
                    }
                    this.InitSMSInfo();
                }
            }
            catch (Exception exception)
            {
                this.HandleException(exception);
            }

⌨️ 快捷键说明

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