?? passwordpage.cs
字號:
?namespace Imps.Client.Pc.Provsion2
{
using Imps.Client.Core;
using Imps.Client.Pc.Controls;
using Imps.Client.Pc.Utils;
using Imps.Client.Resource;
using Imps.Client.Utils;
using Imps.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class PasswordPage : ProvsionControlBase
{
private bool _canMoveNext;
private EventHandler<CertSmsEventArgs> _certSmsRequestSenedHandler;
private EventHandler<FeeInfoEventArgs> _feeInfoRecivedHandler;
private EventHandler _hostSmsTimerTick;
private EventHandler<SubscribeEventArgs> _subScribeEventHandler;
private IContainer components;
private XLabel label1;
private XLabel label2;
private XLabel lbFee;
private XLabel lbFeeInfo;
private XLabel lbIDTips;
private XLabel lblSeperate;
private XLabel lbPass;
private XLabel lbPasswordSection;
private XLabel lbPasswordTip;
private XLabel lbRePassword;
private XLabel lbSmsValiCode;
private XLabel lbSmsValiCodeNotice;
private XLabel lbValiCodeTip;
private XLabel lbWord;
private LinkLabel lnkRegetSmsValiCode;
private XTextBox txtPassword;
private XTextBox txtRePassword;
private XTextBox txtSmsValiCode;
public PasswordPage(ProvisionWizard host) : base(host)
{
this.InitializeComponent();
this.LoadResource();
this.AttachEventHandler();
base.Disposed += new EventHandler(this.PasswordPage_Disposed);
this.Init();
}
private void AttachEventHandler()
{
this._certSmsRequestSenedHandler = new EventHandler<CertSmsEventArgs>(this.Provisioning_OnSmsCertCodeRequestSended);
Imps.Client.Core.Provisioning.OnSmsCertCodeRequestSended += this._certSmsRequestSenedHandler;
this._subScribeEventHandler = new EventHandler<SubscribeEventArgs>(this.Provisioning_OnSubscribe);
Imps.Client.Core.Provisioning.OnSubscribe += this._subScribeEventHandler;
this._hostSmsTimerTick = new EventHandler(this.smsTimer_Tick);
base._host.smsTimer.Tick += this._hostSmsTimerTick;
this._feeInfoRecivedHandler = new EventHandler<FeeInfoEventArgs>(this.Provisioning_OnFeeInformationRecived);
Imps.Client.Core.Provisioning.OnFeeInformationRecived += this._feeInfoRecivedHandler;
}
private bool CheckData()
{
this.txtSmsValiCode.Text = this.txtSmsValiCode.Text.Trim();
this.txtPassword.Text = this.txtPassword.Text.Trim();
this.txtRePassword.Text = this.txtRePassword.Text.Trim();
if (this.txtSmsValiCode.Text.Length == 0)
{
BalloonHelper.ShowBallon(this.txtSmsValiCode, "請?zhí)顚懚绦膨炞C碼!", "錯誤!", ToolTipIcon.Error, 0x5dc);
this.txtSmsValiCode.Focus();
return false;
}
if (!StringHelper.IsAscii(this.txtSmsValiCode.Text))
{
BalloonHelper.ShowBallon(this.txtSmsValiCode, StringTable.MsgAsciiOnly, "請注意", ToolTipIcon.Info, 0x5dc);
return false;
}
if (this.txtPassword.Text.Length > 0)
{
if (this.txtRePassword.Text.Length > 0)
{
if (this.txtPassword.Text != this.txtRePassword.Text)
{
BalloonHelper.ShowBallon(this.txtRePassword, "您兩次輸入的密碼不一致!", "錯誤!", ToolTipIcon.Error, 0x5dc);
this.txtRePassword.SelectAll();
this.txtRePassword.Focus();
return false;
}
if (ControlHelper.IsValidPassword(this.txtPassword.Text))
{
return true;
}
BalloonHelper.ShowBallon(this.txtRePassword, "密碼不符合規(guī)則!", "錯誤!", ToolTipIcon.Error, 0x5dc);
this.txtPassword.SelectAll();
this.txtPassword.Focus();
return false;
}
BalloonHelper.ShowBallon(this.txtRePassword, "請再一次輸入密碼!", "錯誤!", ToolTipIcon.Error, 0x5dc);
this.txtRePassword.Focus();
return false;
}
BalloonHelper.ShowBallon(this.txtPassword, "請輸入密碼!", "錯誤!", ToolTipIcon.Error, 0x5dc);
this.txtPassword.Focus();
return false;
}
public override void DetachEventHandler()
{
if (this._hostSmsTimerTick != null)
{
base._host.smsTimer.Tick -= this._hostSmsTimerTick;
}
if (this._certSmsRequestSenedHandler != null)
{
Imps.Client.Core.Provisioning.OnSmsCertCodeRequestSended -= this._certSmsRequestSenedHandler;
}
if (this._subScribeEventHandler != null)
{
Imps.Client.Core.Provisioning.OnSubscribe -= this._subScribeEventHandler;
}
if (this._feeInfoRecivedHandler != null)
{
Imps.Client.Core.Provisioning.OnFeeInformationRecived -= this._feeInfoRecivedHandler;
}
}
protected override void DisableAllControls()
{
this.txtSmsValiCode.Enabled = false;
this.txtPassword.Enabled = false;
this.txtRePassword.Enabled = false;
this.lnkRegetSmsValiCode.Enabled = false;
base._host.DisableAllButtons();
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
public override bool GetValidData()
{
if (this.CheckData())
{
base._host.ProvsionData.SmsValiCode = this.txtSmsValiCode.Text;
base._host.ProvsionData.Password = this.txtPassword.Text;
return true;
}
return false;
}
private void Init()
{
base._tipMessage = string.Empty;
this.lbValiCodeTip.Text = string.Format(this.lbValiCodeTip.Text, base._host.ProvsionData.MobileNo);
this.lbPasswordTip.Text = StringTable.Password.PasswordRules;
ControlHelper.SetAcceptPasswordChar(this.txtPassword);
ControlHelper.SetAcceptPasswordChar(this.txtRePassword);
ControlHelper.ForceControlImeDisable(this.txtSmsValiCode, true);
}
private void InitializeComponent()
{
this.lblSeperate = new XLabel();
this.label1 = new XLabel();
this.lbSmsValiCode = new XLabel();
this.lbValiCodeTip = new XLabel();
this.lbIDTips = new XLabel();
this.txtSmsValiCode = new XTextBox();
this.lbSmsValiCodeNotice = new XLabel();
this.lbPasswordSection = new XLabel();
this.lbPass = new XLabel();
this.lbRePassword = new XLabel();
this.txtPassword = new XTextBox();
this.txtRePassword = new XTextBox();
this.lnkRegetSmsValiCode = new LinkLabel();
this.lbPasswordTip = new XLabel();
this.lbFeeInfo = new XLabel();
this.label2 = new XLabel();
this.lbWord = new XLabel();
this.lbFee = new XLabel();
base.SuspendLayout();
this.lblSeperate.BorderColor = Color.Empty;
this.lblSeperate.BorderStyle = BorderStyle.Fixed3D;
this.lblSeperate.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblSeperate.Location = new Point(0x84, 0xea);
this.lblSeperate.Name = "lblSeperate";
this.lblSeperate.Size = new Size(320, 2);
this.lblSeperate.TabIndex = 8;
this.lblSeperate.UseMnemonic = false;
this.label1.BorderColor = Color.Empty;
this.label1.BorderStyle = BorderStyle.Fixed3D;
this.label1.ButtonBorderStyle = ButtonBorderStyle.None;
this.label1.Location = new Point(80, 12);
this.label1.Name = "label1";
this.label1.Size = new Size(330, 2);
this.label1.TabIndex = 1;
this.label1.UseMnemonic = false;
this.lbSmsValiCode.AutoSize = true;
this.lbSmsValiCode.BorderColor = Color.Empty;
this.lbSmsValiCode.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbSmsValiCode.Location = new Point(6, 7);
this.lbSmsValiCode.Name = "lbSmsValiCode";
this.lbSmsValiCode.Size = new Size(0x43, 13);
this.lbSmsValiCode.TabIndex = 0;
this.lbSmsValiCode.Text = "短信驗證碼";
this.lbSmsValiCode.UseMnemonic = false;
this.lbValiCodeTip.BorderColor = Color.Empty;
this.lbValiCodeTip.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbValiCodeTip.Location = new Point(0x11, 0x1c);
this.lbValiCodeTip.Name = "lbValiCodeTip";
this.lbValiCodeTip.Size = new Size(0x142, 0x2a);
this.lbValiCodeTip.TabIndex = 2;
this.lbValiCodeTip.Text = "已通過短信方式發(fā)送驗證碼到您的手機[ {0} ]上,請注意查收。請在下面的輸入框中輸入您收到的驗證碼,以鑒別您的身份:";
this.lbValiCodeTip.UseMnemonic = false;
this.lbIDTips.AutoSize = true;
this.lbIDTips.BorderColor = Color.Empty;
this.lbIDTips.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbIDTips.Location = new Point(0x11, 0x34);
this.lbIDTips.Name = "lbIDTips";
this.lbIDTips.Size = new Size(0, 13);
this.lbIDTips.TabIndex = 3;
this.lbIDTips.UseMnemonic = false;
this.txtSmsValiCode.BackColor = Color.White;
this.txtSmsValiCode.BorderStyle = BorderStyle.FixedSingle;
this.txtSmsValiCode.Location = new Point(0x49, 0x4c);
this.txtSmsValiCode.MaxLength = 8;
this.txtSmsValiCode.Name = "txtSmsValiCode";
this.txtSmsValiCode.Size = new Size(0xd8, 20);
this.txtSmsValiCode.TabIndex = 4;
this.lbSmsValiCodeNotice.BorderColor = Color.Empty;
this.lbSmsValiCodeNotice.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbSmsValiCodeNotice.Location = new Point(0x13, 0x66);
this.lbSmsValiCodeNotice.Name = "lbSmsValiCodeNotice";
this.lbSmsValiCodeNotice.Size = new Size(0x14f, 0x2f);
this.lbSmsValiCodeNotice.TabIndex = 5;
this.lbSmsValiCodeNotice.Text = "注意:短信可能由于網(wǎng)絡(luò)等原因有一些延遲,請稍等。\r\n如果您在一分鐘內(nèi)沒有收到短信,\r\n請勿連續(xù)重試!";
this.lbSmsValiCodeNotice.UseMnemonic = false;
this.lbPasswordSection.AutoSize = true;
this.lbPasswordSection.BorderColor = Color.Empty;
this.lbPasswordSection.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbPasswordSection.Location = new Point(6, 0xe4);
this.lbPasswordSection.Name = "lbPasswordSection";
this.lbPasswordSection.Size = new Size(120, 13);
this.lbPasswordSection.TabIndex = 7;
this.lbPasswordSection.Text = "請設(shè)置您的Fetion密碼";
this.lbPasswordSection.UseMnemonic = false;
this.lbPass.AutoSize = true;
this.lbPass.BorderColor = Color.Empty;
this.lbPass.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbPass.Location = new Point(0x17, 0xfb);
this.lbPass.Name = "lbPass";
this.lbPass.Size = new Size(0x13, 13);
this.lbPass.TabIndex = 9;
this.lbPass.Text = "密";
this.lbPass.UseMnemonic = false;
this.lbRePassword.AutoSize = true;
this.lbRePassword.BorderColor = Color.Empty;
this.lbRePassword.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbRePassword.Location = new Point(0x17, 0x114);
this.lbRePassword.Name = "lbRePassword";
this.lbRePassword.Size = new Size(0x37, 13);
this.lbRePassword.TabIndex = 11;
this.lbRePassword.Text = "確認(rèn)密碼";
this.lbRePassword.UseMnemonic = false;
this.txtPassword.BackColor = Color.White;
this.txtPassword.BorderStyle = BorderStyle.FixedSingle;
this.txtPassword.Location = new Point(0x56, 0xf7);
this.txtPassword.MaxLength = 0x10;
this.txtPassword.Name = "txtPassword";
this.txtPassword.PasswordChar = '*';
this.txtPassword.Size = new Size(0xaf, 20);
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -