📄 pspasscontrol.cs
字号:
namespace Imps.Client.Pc.Options
{
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Pc.Controls;
using Imps.Client.Pc.Utils;
using Imps.Client.Resource;
using Imps.Client.Utils;
using Imps.Common.Permission;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
public class PsPassControl : OptionsControlBase
{
private IFrameworkWindow _frameworkWindow;
private ValueNameDescList<int> _listIvrBuddy;
private XButton btnChangePassword;
private CheckBox cbStrangerBlock;
private IContainer components;
private GroupBox groupBox1;
private GroupBox groupBox2;
private GroupBox groupBox3;
private GroupBox groupBox4;
private XLabel lbAddBuddyTip;
private XLabel lbConfirmNewPassword;
private XLabel lbNewPassword;
private XLabel lbOldPassword;
private XLabel lbRule;
private RadioButton rbAgreeAll;
private RadioButton rbNeedApply;
private RadioButton rbRejectAll;
private XTextBox tbNewPwd;
private XTextBox tbNewPwdConfirm;
private XTextBox tbOldPwd;
private XComboBox xcbIvrBuddy;
private XComboBox xcbIvrElse;
private XLabel xLabel1;
private XLabel xLabel2;
public PsPassControl(IFrameworkWindow iFrameworkWindow)
{
this._frameworkWindow = iFrameworkWindow;
this.InitializeComponent();
this.initIvrBuddyComboBox();
this.SetLimitation();
this.HandleUiEvent();
}
private void btnChangePassword_Click(object sender, EventArgs e)
{
this.DoChangePassword();
}
private void cbStrangerBlock_CheckedChanged(object sender, EventArgs e)
{
this.DoEnableIvrElse();
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void DoChangePassword()
{
UiErrorHelper.HandEventSafely(this._frameworkWindow, delegate {
if (this.InnerCheckUserInput())
{
this.btnChangePassword.Enabled = false;
AsyncBizOperation op = new AsyncBizOperation();
op.ImpsError += new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this.op_ImpsError);
op.Successed += new EventHandler(this.op_Successed);
if (!this.CurrentUser.AsyncChangePassword(this.tbOldPwd.Text, this.tbNewPwd.Text, op))
{
this._frameworkWindow.UnifiedMessageBox.ShowError(StringTable.PersonalInfo.MsgChangePassword_Failed);
this.btnChangePassword.Enabled = true;
}
}
});
}
private void DoEnableIvrElse()
{
try
{
this.xcbIvrElse.Enabled = !this.cbStrangerBlock.Checked;
if (this.cbStrangerBlock.Checked)
{
this.xcbIvrElse.SelectedValue = 0;
}
}
catch
{
}
}
private int getIvrValue()
{
int num2 = (this.xcbIvrBuddy.SelectedValue == null) ? -1 : ((int) this.xcbIvrBuddy.SelectedValue);
int num3 = (this.xcbIvrElse.SelectedValue == null) ? -1 : ((int) this.xcbIvrElse.SelectedValue);
switch (num2)
{
case 2:
switch (num3)
{
case 2:
return 1;
case 1:
return 2;
}
return 3;
case 1:
if (num3 == 1)
{
return 4;
}
return 5;
}
return 0;
}
private void groupBox2_Enter(object sender, EventArgs e)
{
}
private void HandleUiEvent()
{
this.rbAgreeAll.CheckedChanged += new EventHandler(this.uiData_Changed);
this.rbNeedApply.CheckedChanged += new EventHandler(this.uiData_Changed);
this.rbRejectAll.CheckedChanged += new EventHandler(this.uiData_Changed);
this.cbStrangerBlock.CheckedChanged += new EventHandler(this.uiData_Changed);
this.xcbIvrBuddy.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
this.xcbIvrElse.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
}
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(PsPassControl));
this.lbOldPassword = new XLabel();
this.tbOldPwd = new XTextBox();
this.tbNewPwd = new XTextBox();
this.lbNewPassword = new XLabel();
this.tbNewPwdConfirm = new XTextBox();
this.lbConfirmNewPassword = new XLabel();
this.btnChangePassword = new XButton();
this.lbRule = new XLabel();
this.groupBox1 = new GroupBox();
this.xcbIvrElse = new XComboBox();
this.xcbIvrBuddy = new XComboBox();
this.cbStrangerBlock = new CheckBox();
this.rbRejectAll = new RadioButton();
this.rbNeedApply = new RadioButton();
this.rbAgreeAll = new RadioButton();
this.lbAddBuddyTip = new XLabel();
this.groupBox2 = new GroupBox();
this.groupBox3 = new GroupBox();
this.groupBox4 = new GroupBox();
this.xLabel2 = new XLabel();
this.xLabel1 = new XLabel();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
base.SuspendLayout();
this.lbOldPassword.BorderColor = Color.Empty;
this.lbOldPassword.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbOldPassword.Location = new System.Drawing.Point(0x1b, 0x1c);
this.lbOldPassword.Name = "lbOldPassword";
this.lbOldPassword.Size = new Size(0x41, 12);
this.lbOldPassword.TabIndex = 2;
this.lbOldPassword.Text = "当前密码:";
this.lbOldPassword.TextAlign = ContentAlignment.TopRight;
this.tbOldPwd.BackColor = Color.White;
this.tbOldPwd.BorderStyle = BorderStyle.FixedSingle;
this.tbOldPwd.EmptyTextTip = "";
this.tbOldPwd.EmptyTextTipColor = Color.DarkGray;
this.tbOldPwd.Location = new System.Drawing.Point(0x62, 0x1a);
this.tbOldPwd.MaxLength = 0x10;
this.tbOldPwd.Name = "tbOldPwd";
this.tbOldPwd.Size = new Size(0xc5, 0x15);
this.tbOldPwd.TabIndex = 3;
this.tbOldPwd.set_UseSystemPasswordChar(true);
this.tbNewPwd.BackColor = Color.White;
this.tbNewPwd.BorderStyle = BorderStyle.FixedSingle;
this.tbNewPwd.EmptyTextTip = "";
this.tbNewPwd.EmptyTextTipColor = Color.DarkGray;
this.tbNewPwd.Location = new System.Drawing.Point(0x62, 0x54);
this.tbNewPwd.MaxLength = 0x10;
this.tbNewPwd.Name = "tbNewPwd";
this.tbNewPwd.Size = new Size(0xc5, 0x15);
this.tbNewPwd.TabIndex = 5;
this.tbNewPwd.set_UseSystemPasswordChar(true);
this.lbNewPassword.BorderColor = Color.Empty;
this.lbNewPassword.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbNewPassword.Location = new System.Drawing.Point(0x1b, 0x38);
this.lbNewPassword.Name = "lbNewPassword";
this.lbNewPassword.Size = new Size(0x41, 12);
this.lbNewPassword.TabIndex = 4;
this.lbNewPassword.Text = "新密码:";
this.lbNewPassword.TextAlign = ContentAlignment.TopRight;
this.tbNewPwdConfirm.BackColor = Color.White;
this.tbNewPwdConfirm.BorderStyle = BorderStyle.FixedSingle;
this.tbNewPwdConfirm.EmptyTextTip = "";
this.tbNewPwdConfirm.EmptyTextTipColor = Color.DarkGray;
this.tbNewPwdConfirm.Location = new System.Drawing.Point(0x62, 0x36);
this.tbNewPwdConfirm.MaxLength = 0x10;
this.tbNewPwdConfirm.Name = "tbNewPwdConfirm";
this.tbNewPwdConfirm.set_ShortcutsEnabled(false);
this.tbNewPwdConfirm.Size = new Size(0xc5, 0x15);
this.tbNewPwdConfirm.TabIndex = 4;
this.tbNewPwdConfirm.set_UseSystemPasswordChar(true);
this.lbConfirmNewPassword.BorderColor = Color.Empty;
this.lbConfirmNewPassword.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbConfirmNewPassword.Location = new System.Drawing.Point(0x1b, 0x56);
this.lbConfirmNewPassword.Name = "lbConfirmNewPassword";
this.lbConfirmNewPassword.Size = new Size(0x41, 12);
this.lbConfirmNewPassword.TabIndex = 6;
this.lbConfirmNewPassword.Text = "重新输入:";
this.lbConfirmNewPassword.TextAlign = ContentAlignment.TopRight;
this.btnChangePassword.AutoArrangementX = true;
this.btnChangePassword.AutoSizeToImage = false;
this.btnChangePassword.BackColor = Color.Transparent;
this.btnChangePassword.BackgroundImage = (Image) manager.GetObject("btnChangePassword.BackgroundImage");
this.btnChangePassword.BackgroundImageDisable = (Image) manager.GetObject("btnChangePassword.BackgroundImageDisable");
this.btnChangePassword.BackgroundImageDown = (Image) manager.GetObject("btnChangePassword.BackgroundImageDown");
this.btnChangePassword.BackgroundImageHover = (Image) manager.GetObject("btnChangePassword.BackgroundImageHover");
this.btnChangePassword.ChangeSkin = false;
this.btnChangePassword.Location = new System.Drawing.Point(0x12d, 0x54);
this.btnChangePassword.Name = "btnChangePassword";
this.btnChangePassword.Size = new Size(0x4b, 0x15);
this.btnChangePassword.TabIndex = 8;
this.btnChangePassword.set_UseVisualStyleBackColor(false);
this.btnChangePassword.Click += new EventHandler(this.btnChangePassword_Click);
this.lbRule.BorderColor = Color.Empty;
this.lbRule.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbRule.ForeColor = Color.Red;
this.lbRule.Location = new System.Drawing.Point(0x1b, 0x6c);
this.lbRule.Name = "lbRule";
this.lbRule.Size = new Size(0x15b, 0x3b);
this.lbRule.TabIndex = 9;
this.lbRule.Text = "lbRule";
this.groupBox1.Controls.Add(this.lbOldPassword);
this.groupBox1.Controls.Add(this.lbRule);
this.groupBox1.Controls.Add(this.tbOldPwd);
this.groupBox1.Controls.Add(this.btnChangePassword);
this.groupBox1.Controls.Add(this.lbNewPassword);
this.groupBox1.Controls.Add(this.tbNewPwdConfirm);
this.groupBox1.Controls.Add(this.tbNewPwd);
this.groupBox1.Controls.Add(this.lbConfirmNewPassword);
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new Size(0x19e, 170);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "修改密码";
this.xcbIvrElse.BackColor = Color.White;
this.xcbIvrElse.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbIvrElse.EmptyTextTip = "";
this.xcbIvrElse.EmptyTextTipColor = Color.DarkGray;
this.xcbIvrElse.set_FormattingEnabled(true);
this.xcbIvrElse.Location = new System.Drawing.Point(0xf6, 0x33);
this.xcbIvrElse.Name = "xcbIvrElse";
this.xcbIvrElse.Size = new Size(0x80, 20);
this.xcbIvrElse.TabIndex = 2;
this.xcbIvrBuddy.BackColor = Color.White;
this.xcbIvrBuddy.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbIvrBuddy.EmptyTextTip = "";
this.xcbIvrBuddy.EmptyTextTipColor = Color.DarkGray;
this.xcbIvrBuddy.set_FormattingEnabled(true);
this.xcbIvrBuddy.Location = new System.Drawing.Point(0xf6, 20);
this.xcbIvrBuddy.Name = "xcbIvrBuddy";
this.xcbIvrBuddy.Size = new Size(0x80, 20);
this.xcbIvrBuddy.TabIndex = 1;
this.xcbIvrBuddy.SelectedIndexChanged += new EventHandler(this.xcbIvrBuddy_SelectedIndexChanged);
this.cbStrangerBlock.set_AutoSize(true);
this.cbStrangerBlock.Location = new System.Drawing.Point(0x1d, 0x1a);
this.cbStrangerBlock.Name = "cbStrangerBlock";
this.cbStrangerBlock.Size = new Size(0x84, 0x10);
this.cbStrangerBlock.TabIndex = 0;
this.cbStrangerBlock.Text = "拒绝陌生人和我联系";
this.cbStrangerBlock.set_UseVisualStyleBackColor(true);
this.cbStrangerBlock.CheckedChanged += new EventHandler(this.cbStrangerBlock_CheckedChanged);
this.rbRejectAll.set_AutoSize(true);
this.rbRejectAll.Location = new System.Drawing.Point(0x121, 0x37);
this.rbRejectAll.Name = "rbRejectAll";
this.rbRejectAll.Size = new Size(0x47, 0x10);
this.rbRejectAll.TabIndex = 2;
this.rbRejectAll.TabStop = true;
this.rbRejectAll.Text = "全部拒绝";
this.rbRejectAll.set_UseVisualStyleBackColor(true);
this.rbNeedApply.set_AutoSize(true);
this.rbNeedApply.Location = new System.Drawing.Point(0x98, 0x37);
this.rbNeedApply.Name = "rbNeedApply";
this.rbNeedApply.Size = new Size(0x5f, 0x10);
this.rbNeedApply.TabIndex = 1;
this.rbNeedApply.TabStop = true;
this.rbNeedApply.Text = "需要向我申请";
this.rbNeedApply.set_UseVisualStyleBackColor(true);
this.rbAgreeAll.set_AutoSize(true);
this.rbAgreeAll.Location = new System.Drawing.Point(0x1d, 0x37);
this.rbAgreeAll.Name = "rbAgreeAll";
this.rbAgreeAll.Size = new Size(0x47, 0x10);
this.rbAgreeAll.TabIndex = 0;
this.rbAgreeAll.TabStop = true;
this.rbAgreeAll.Text = "全部同意";
this.rbAgreeAll.set_UseVisualStyleBackColor(true);
this.lbAddBuddyTip.set_AutoSize(true);
this.lbAddBuddyTip.BorderColor = Color.Empty;
this.lbAddBuddyTip.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbAddBuddyTip.Location = new System.Drawing.Point(0x1b, 0x1d);
this.lbAddBuddyTip.Name = "lbAddBuddyTip";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -