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

📄 personalgroupmanager.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 4 页
字号:
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void ShowGroupMessageHistory(PersonalGroup group)
        {
            try
            {
                this._framework.MessageHistoryManager.ShowMessageHistory(this._framework.MainWindow, group.Uri.Raw);
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void ShowGroupSetting(IWin32Window owner, PersonalGroup group, GroupOption option)
        {
            try
            {
                if (this._groupSettingForms == null)
                {
                    this._groupSettingForms = new Dictionary<PersonalGroup, Form>();
                }
                if (this._groupSettingForms.ContainsKey(group) && !this._groupSettingForms.get_Item(group).IsDisposed)
                {
                    this._groupSettingForms.get_Item(group).Activate();
                }
                else
                {
                    if (this._groupSettingForms.ContainsKey(group))
                    {
                        this._groupSettingForms.Remove(group);
                    }
                    Form form = new GroupOptionFrom(this._framework, group, option);
                    if (owner == null)
                    {
                        ControlHelper.ShowFormCenterOnParent(form, this._framework.MainWindow);
                    }
                    else
                    {
                        ControlHelper.ShowFormCenterOnParent(form, owner);
                    }
                    this._groupSettingForms.Add(group, form);
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void ShowInviteForm(IWin32Window owner, List<Contact> inviteContacts, PersonalGroup group)
        {
            try
            {
                if ((group.MemberLoadStatus == PersonalGroupLoadStatus.Loaded) && (group.Members.Count >= group.GroupInfo.LimitMemberCount))
                {
                    this._framework.UnifiedMessageBox.ShowError("您的群成员数量已达上限,不能再发送邀请!");
                }
                else
                {
                    if (this._inviteFriendsForms == null)
                    {
                        this._inviteFriendsForms = new Dictionary<PersonalGroup, Form>();
                    }
                    if (this._inviteFriendsForms.ContainsKey(group) && !this._inviteFriendsForms.get_Item(group).IsDisposed)
                    {
                        this._inviteFriendsForms.get_Item(group).Activate();
                    }
                    else
                    {
                        if (this._inviteFriendsForms.ContainsKey(group))
                        {
                            this._inviteFriendsForms.Remove(group);
                        }
                        Form form = new GroupInviteForm(this._framework, inviteContacts, group);
                        if (owner == null)
                        {
                            ControlHelper.ShowFormCenterOnParent(form, this._framework.MainWindow);
                        }
                        else
                        {
                            ControlHelper.ShowFormCenterOnParent(form, owner);
                        }
                        this._inviteFriendsForms.Add(group, form);
                    }
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void ShowMemberInfo(IWin32Window owner, PersonalGroupMember member)
        {
            try
            {
                if (member.Uri.Raw == this.CurrentUser.Uri.Raw)
                {
                    this._framework.ShowOptions("PsGeneral");
                }
                else
                {
                    this._framework.ContactManager.ShowContactDetail(owner, member.Uri.Raw);
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void ShowMemberMessageHistory(IWin32Window owner, PersonalGroupMember member)
        {
            try
            {
                this._framework.MessageHistoryManager.ShowMessageHistory(owner, member.Uri.Raw);
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void StartGroupConversation(IWin32Window owner, PersonalGroup group, ConversationOperation operation)
        {
            try
            {
                if (this.CurrentUser.Status == UserAccountStatus.Logon)
                {
                    if (!group.UserInfo.EnableGroupSendMessage)
                    {
                        this._framework.UnifiedMessageBox.ShowError(owner, "您现在还不能发送群消息!");
                    }
                    else if (group.GroupConversation == null)
                    {
                        ClientLogger.WriteGeneral("群会话没有创建,无法开始会话:" + group.Uri.Raw);
                    }
                    else
                    {
                        GroupConversationForm form = this.FindConversationForm(group);
                        if (form != null)
                        {
                            Imps.Client.Utils.Win32.NativeMethods.ShowWindow(form.Handle, 9);
                            if (operation == ConversationOperation.ImChat)
                            {
                                form.SendSMS = false;
                            }
                            else if (operation == ConversationOperation.SmsChat)
                            {
                                form.SendSMS = true;
                            }
                            form.Activate();
                        }
                        else
                        {
                            this.CreateConversationForm(group, operation).Show();
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void StartMemeberConversation(IWin32Window owner, PersonalGroupMember member, ConversationOperation operation)
        {
            try
            {
                if (member.Uri.Raw == this.CurrentUser.Uri.Raw)
                {
                    this._framework.ShowOptions("PsGeneral");
                }
                else
                {
                    Contact contact = this.CurrentUser.ContactList.FindContact(member.Uri.Raw, false);
                    if ((contact != null) && !(contact is ChatFriend))
                    {
                        this._framework.ConversationManager.StartConversation(owner, ConversationOperation.ImChat, new string[] { member.Uri.Raw });
                    }
                    else if (member.EnableIM)
                    {
                        this._framework.ConversationManager.StartStrangerConversation(owner, member.Uri.Raw);
                    }
                    else
                    {
                        string text = "由于对方不是您的好友,所以您不能给对方发送消息,\r\n\r\n是否添加对方为好友?";
                        if (this._framework.UnifiedMessageBox.ShowConfirmation(this._framework.MainWindow, text) == DialogResult.Yes)
                        {
                            string mobileNo = string.IsNullOrEmpty(member.PersonalInfo.MobileNo) ? member.PersonalInfo.MobileNoUserSet : member.PersonalInfo.MobileNo;
                            this._framework.ContactManager.ShowAddBuddyWindow(this._framework.MainWindow, mobileNo, new long?(member.Uri.Sid), string.Empty, null, ContactType.ImpsContact);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public void VisitGroupWebSite(PersonalGroup group)
        {
            try
            {
                FunctionHelper.StartFunc(WebFunction.PersonalGroup, string.Format("GroupID={0}", group.GroupInfo.Id));
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        public List<GroupConversationForm> ConvForms
        {
            get
            {
                if (this._convForms == null)
                {
                    this._convForms = new List<GroupConversationForm>();
                }
                return this._convForms;
            }
        }

        internal User CurrentUser
        {
            get
            {
                return this._framework.AccountManager.CurrentUser;
            }
        }

        public Control PersonalGroupEntryListControl
        {
            get
            {
                if (this._personalGroupEntryListControl == null)
                {
                    this._personalGroupEntryListControl = new Imps.Client.Pc.PersonalGroupEntryListControl(this._framework);
                }
                return this._personalGroupEntryListControl;
            }
        }

        public Control ToolbarControl
        {
            get
            {
                if ((this._toolbar == null) || this._toolbar.IsDisposed)
                {
                    this._toolbar = new BGroupListControlToolbar();
                    this._toolbar.Dock = DockStyle.Top;
                }
                return this._toolbar;
            }
        }
    }
}

⌨️ 快捷键说明

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