📄 provisionwizard.cs
字号:
namespace Imps.Client.Pc.Provsion2
{
using Imps.Client;
using Imps.Client.Base;
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Pc.BizControls;
using Imps.Client.Pc.Controls;
using Imps.Client.Resource;
using Imps.Client.Utils;
using Imps.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
public class ProvisionWizard : XIMDialog, IHandleUserStatusSelf
{
private ProvsionStage _provsionStage = ProvsionStage.License;
internal bool autoLogin;
private XButton btnCancel;
private XButton btnNext;
private XButton btnPrevious;
internal bool canSendSmsRequest = true;
private IContainer components;
internal Imps.Client.Core.Configuration Config;
internal IFrameworkWindow frmWnd;
private int i;
private XLabel lbTip;
internal int MinSmsRequestSpanSeconds;
internal IUnifiedMessageBox MsgBox;
public EventHandler<HttpAppEventArgs> OnMoveNextHandler;
public EventHandler<TipMessageEventArgs> OnTipMessageChangedHandler;
private PictureBox pbProvision;
private Panel pnlContainer;
private Panel pnlPage;
private ProvsionControlBase ProvsionControl;
public Imps.Client.Core.ProvsionData ProvsionData;
internal volatile int smsTickCounter;
internal Timer smsTimer;
public EventHandler<SysCfgEventArgs> SysCfgReceivedHandler;
public EventHandler<UserSatusChangedEventArgs> UserStatusChangedHandler;
public event EventHandler<SysCfgEventArgs> OnSysCfgAvaild;
public ProvisionWizard(IFrameworkWindow wnd)
{
this.InitializeComponent();
this.Init(wnd);
this.AttachEventHandler();
this.LoadResource();
this.LoadControl();
}
private void AttachEventHandler()
{
Imps.Client.Core.Provisioning.OnSysCfgRecived += this.SysCfgReceivedHandler;
this.frmWnd.AccountManager.CurrentUser.StatusChanged += this.UserStatusChangedHandler;
}
private void btnCancel_Click(object sender, EventArgs e)
{
base.Close();
}
private void btnNext_Click(object sender, EventArgs e)
{
if (this.ProvsionControl.GetValidData())
{
this.ProvsionControl.MoveToNextStage();
}
}
private void btnPrevious_Click(object sender, EventArgs e)
{
this.GetPreStage();
}
private void CurrentUser_StatusChanged(object sender, UserSatusChangedEventArgs e)
{
this.ProvsionControl.CancelConfirmMsg = string.Empty;
base.Close();
}
private void DetachEventHandler()
{
Imps.Client.Core.Provisioning.OnSysCfgRecived -= this.SysCfgReceivedHandler;
this.frmWnd.AccountManager.CurrentUser.StatusChanged -= this.UserStatusChangedHandler;
this.ProvsionControl.DetachEventHandler();
}
internal void DisableAllButtons()
{
this.btnPrevious.Enabled = false;
this.btnNext.Enabled = false;
this.btnCancel.Enabled = false;
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
internal void EnableNextStep(bool enable)
{
this.btnNext.Enabled = enable;
}
private void GetNextStage()
{
this._provsionStage = this.ProvsionControl.NextStage;
this.LoadControl();
}
internal void GetPreStage()
{
this._provsionStage = ProvsionStage.License;
this.LoadControl();
}
private void Init(IFrameworkWindow wnd)
{
this.frmWnd = wnd;
this.MsgBox = wnd.UnifiedMessageBox;
this.Config = wnd.AccountManager.CurrentUser.Configuration;
this.ProvsionData = new Imps.Client.Core.ProvsionData();
this.ProvsionData.CurrentUser = wnd.AccountManager.CurrentUser;
this.OnMoveNextHandler = new EventHandler<HttpAppEventArgs>(this, (IntPtr) this.ProvsionControl_OnMoveNext);
this.OnTipMessageChangedHandler = new EventHandler<TipMessageEventArgs>(this, (IntPtr) this.ProvsionControl_OnTipMessageChanged);
this.SysCfgReceivedHandler = new EventHandler<SysCfgEventArgs>(this, (IntPtr) this.Provisioning_OnSysCfgRecived);
this.ProvsionData.ProvsionUrl.UriGetSysCfg = Imps.Client.Core.Configuration.FixedClientSetting.NavigatorServerUri;
this.UserStatusChangedHandler = new EventHandler<UserSatusChangedEventArgs>(this, (IntPtr) this.CurrentUser_StatusChanged);
}
private void InitializeComponent()
{
this.components = new Container();
ComponentResourceManager manager = new ComponentResourceManager(typeof(ProvisionWizard));
this.pnlPage = new Panel();
this.btnCancel = new XButton();
this.btnNext = new XButton();
this.btnPrevious = new XButton();
this.pbProvision = new PictureBox();
this.pnlContainer = new Panel();
this.lbTip = new XLabel();
this.smsTimer = new Timer(this.components);
this.pbProvision.BeginInit();
this.pnlContainer.SuspendLayout();
base.SuspendLayout();
this.pnlPage.Location = new System.Drawing.Point(0x9d, 5);
this.pnlPage.Name = "pnlPage";
this.pnlPage.Size = new Size(0x17e, 0x12e);
this.pnlPage.TabIndex = 0;
this.btnCancel.AutoArrangementX = true;
this.btnCancel.AutoSizeToImage = false;
this.btnCancel.BackColor = Color.Transparent;
this.btnCancel.BackgroundImageDisable = null;
this.btnCancel.BackgroundImageDown = null;
this.btnCancel.BackgroundImageHover = null;
this.btnCancel.ChangeSkin = true;
this.btnCancel.DialogResult = DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(470, 0x16a);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new Size(0x4b, 0x19);
this.btnCancel.TabIndex = 4;
this.btnCancel.Text = "取消(&C)";
this.btnCancel.set_UseVisualStyleBackColor(false);
this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
this.btnNext.AutoArrangementX = true;
this.btnNext.AutoSizeToImage = false;
this.btnNext.BackColor = Color.Transparent;
this.btnNext.BackgroundImageDisable = null;
this.btnNext.BackgroundImageDown = null;
this.btnNext.BackgroundImageHover = null;
this.btnNext.ChangeSkin = true;
this.btnNext.Location = new System.Drawing.Point(0x185, 0x16a);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new Size(0x4b, 0x19);
this.btnNext.TabIndex = 3;
this.btnNext.Text = "下一步(&N)";
this.btnNext.set_UseVisualStyleBackColor(false);
this.btnNext.Click += new EventHandler(this.btnNext_Click);
this.btnPrevious.AutoArrangementX = true;
this.btnPrevious.AutoSizeToImage = false;
this.btnPrevious.BackColor = Color.Transparent;
this.btnPrevious.BackgroundImageDisable = null;
this.btnPrevious.BackgroundImageDown = null;
this.btnPrevious.BackgroundImageHover = null;
this.btnPrevious.ChangeSkin = true;
this.btnPrevious.Location = new System.Drawing.Point(0x134, 0x16a);
this.btnPrevious.Name = "btnPrevious";
this.btnPrevious.Size = new Size(0x4b, 0x19);
this.btnPrevious.TabIndex = 2;
this.btnPrevious.Text = "上一步(&L)";
this.btnPrevious.set_UseVisualStyleBackColor(false);
this.btnPrevious.Click += new EventHandler(this.btnPrevious_Click);
this.pbProvision.Dock = DockStyle.Left;
this.pbProvision.set_ErrorImage(null);
this.pbProvision.set_InitialImage(null);
this.pbProvision.Location = new System.Drawing.Point(0, 0);
this.pbProvision.Name = "pbProvision";
this.pbProvision.Size = new Size(0x97, 0x13c);
this.pbProvision.TabIndex = 0;
this.pbProvision.TabStop = false;
this.pnlContainer.BackColor = Color.Transparent;
this.pnlContainer.Controls.Add(this.pnlPage);
this.pnlContainer.Controls.Add(this.lbTip);
this.pnlContainer.Controls.Add(this.pbProvision);
this.pnlContainer.Location = new System.Drawing.Point(6, 0x1f);
this.pnlContainer.Name = "pnlContainer";
this.pnlContainer.Size = new Size(0x222, 0x13c);
this.pnlContainer.TabIndex = 0;
this.lbTip.set_AutoSize(true);
this.lbTip.BorderColor = Color.Empty;
this.lbTip.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbTip.Location = new System.Drawing.Point(8, 0x149);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -