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

📄 basicprofiliecontrol.cs

📁 飞信的收发使用csharp进行开发
💻 CS
📖 第 1 页 / 共 3 页
字号:
                    _widget.BringToFront();
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_edit_copy(object sender, EventArgs e)
        {
            try
            {
                ChatEditCtrlManager txtNicknameMng = null;
                if (this.txtNickname.Focused)
                {
                    txtNicknameMng = this.m_txtNicknameMng;
                }
                else if (this.xTextBoxMoodPhrase.Focused)
                {
                    txtNicknameMng = this.m_xTextBoxMoodPhraseMng;
                }
                if (txtNicknameMng != null)
                {
                    txtNicknameMng.DoCopy();
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_edit_opening(object sender, CancelEventArgs e)
        {
            try
            {
                ChatEditCtrlManager txtNicknameMng = null;
                if (this.txtNickname.Focused)
                {
                    txtNicknameMng = this.m_txtNicknameMng;
                }
                else if (this.xTextBoxMoodPhrase.Focused)
                {
                    txtNicknameMng = this.m_xTextBoxMoodPhraseMng;
                }
                if (txtNicknameMng != null)
                {
                    this.m_menu_edit_copy.Enabled = txtNicknameMng.CanCopy;
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_edit_selectall(object sender, EventArgs e)
        {
            try
            {
                if (this.txtNickname.Focused)
                {
                    this.txtNickname.SelectAll();
                }
                else if (this.xTextBoxMoodPhrase.Focused)
                {
                    this.xTextBoxMoodPhrase.SelectAll();
                }
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_wedit_copy(object sender, EventArgs e)
        {
            try
            {
                this.m_xTextBoxBackNameMng.DoCopy();
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_wedit_cut(object sender, EventArgs e)
        {
            try
            {
                this.m_xTextBoxBackNameMng.DoCut();
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_wedit_delete(object sender, EventArgs e)
        {
            try
            {
                this.xTextBoxBackName.SelectedText = string.Empty;
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_wedit_opening(object sender, CancelEventArgs e)
        {
            try
            {
                this.m_menu_wedit_undo.Enabled = this.m_xTextBoxBackNameMng.CanUndo;
                this.m_menu_wedit_cut.Enabled = this.m_xTextBoxBackNameMng.CanCut;
                this.m_menu_wedit_copy.Enabled = this.m_xTextBoxBackNameMng.CanCopy;
                this.m_menu_wedit_paste.Enabled = this.m_xTextBoxBackNameMng.CanPaste;
                this.m_menu_wedit_delete.Enabled = this.m_xTextBoxBackNameMng.CanCut;
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_wedit_paste(object sender, EventArgs e)
        {
            try
            {
                this.m_xTextBoxBackNameMng.DoPaste();
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_wedit_selectall(object sender, EventArgs e)
        {
            try
            {
                this.xTextBoxBackName.SelectAll();
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_menu_wedit_undo(object sender, EventArgs e)
        {
            try
            {
                this.m_xTextBoxBackNameMng.DoUndo();
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void on_richedit_mousedown(object sender, MouseEventArgs e)
        {
            try
            {
                (sender as ChatRichTextBox).Focus();
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        protected override void OnHandleDestroyed(EventArgs e)
        {
            base.OnHandleDestroyed(e);
            try
            {
                this.txtNickname.MouseDown -= new MouseEventHandler(this.on_richedit_mousedown);
                this.xTextBoxMoodPhrase.MouseDown -= new MouseEventHandler(this.on_richedit_mousedown);
            }
            catch (Exception exception)
            {
                ClientLogger.WriteException(exception);
            }
        }

        private void PersonalInfo_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._iFrameworkWindow, delegate {
                if (e.ContainsAnyOfProperties(new string[] { "nickname", "name", "Age", "gender", "province", "city", "profile", "Portrait" }))
                {
                    this.UpdateData(false);
                }
            });
        }

        private void Presence_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._iFrameworkWindow, delegate {
                if (e.ContainsAnyOfProperties(new string[] { "mobile-device-status", "MoodPhrase" }))
                {
                    this.UpdateData(false);
                }
            });
        }

        protected override void UIData_Changed(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._iFrameworkWindow, delegate {
                base.Modified = true;
            });
        }

        public override bool UpdateData(bool update)
        {
            if (update)
            {
                if (!this.CheckUserInput())
                {
                    return false;
                }
                this._contact.PersonalInfo.Name.UserSetDataProposedValue = this.m_xTextBoxBackNameMng.Text.Trim();
                this._contact.OnlineNotify.ProposedValue = this.chkOnlineNotify.Checked;
                if (this._iFrameworkWindow.AccountManager.CurrentUser.Configuration.UserSetting.NotifyWinodwSetting.OnlineNotify == 2)
                {
                    this.chkOnlineNotify.Enabled = true;
                }
                else
                {
                    this.chkOnlineNotify.Enabled = false;
                }
                if (this._contact.Presence.CrbtToMe != null)
                {
                    this.LabelCrbtToMe.Text = this._contact.Presence.CrbtToMe.ToneName;
                }
            }
            else
            {
                this.chkOnlineNotify.Checked = this._contact.OnlineNotify.Value;
                this.txtNickname.Text = string.Empty;
                this.m_txtNicknameMng.AppentString(this._contact.PersonalInfo.Nickname.Value);
                this.txtNickname.ClearUndo();
                this.txtName.Text = this._contact.PersonalInfo.Name.ContactSetData;
                this.xTextBoxMoodPhrase.Text = string.Empty;
                this.m_xTextBoxMoodPhraseMng.AppentString(this._contact.Presence.MoodPhrase);
                this.xTextBoxMoodPhrase.ClearUndo();
                this.xTextBoxBackName.Text = string.Empty;
                this.m_xTextBoxBackNameMng.AppentString(this._contact.PersonalInfo.Name.UserSetDataProposedValue);
                this.xTextBoxBackName.ClearUndo();
                int age = this._contact.PersonalInfo.Age;
                this.lblAge.Text = ((age > 0x63) || (age < 2)) ? "" : age.ToString();
                this.MobileNoStatus.Text = PhoneStatusHelper.PhoneStatus2Str(this._contact.Presence.PhoneStatus);
                this.lbGender.Text = GenderHelper.Gender2Str(this._contact.PersonalInfo.Gender);
                string str = CodeTraslator.ToProvince(this._contact.PersonalInfo.Province.Value.ToString());
                string str2 = CodeTraslator.ToCity(this._contact.PersonalInfo.City.Value.ToString());
                if (str == string.Empty)
                {
                    this.lblProvinceCity.Text = str2;
                }
                else if (str2 == string.Empty)
                {
                    this.lblProvinceCity.Text = str;
                }
                else
                {
                    this.lblProvinceCity.Text = string.Format(StringTable.PersonalInfo.MsgProvinceCity, str, str2);
                }
                this.imgPortrait.Image = this._contact.PersonalInfo.Portrait;
                this.xTextBoxGroupName.Text = this._contact.BelongToGroupsName;
            }
            base.Modified = false;
            return true;
        }

        private void xTextBoxGroupName_TextChanged(object sender, EventArgs e)
        {
        }
    }
}

⌨️ 快捷键说明

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