📄 loginfailedform.cs
字号:
namespace Imps.Client.Pc.UserAccount
{
using Imps.Client.Core;
using Imps.Client.Pc.BizControls;
using Imps.Client.Pc.Controls;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class LoginFailedForm : XIMDialog
{
private readonly int _errorCode;
private readonly User _user;
private XButton btnCancel;
private XButton btnDetail;
private XButton btnOk;
private IContainer components;
private readonly string errorDesc;
private XLabel lbInfo;
private Panel pnlContainer;
public LoginFailedForm(ImpsErrorEventArgs e, User currentUser) : this(e.ErrorCode, currentUser)
{
this.errorDesc = e.Summary + "\r\n" + e.Description;
}
public LoginFailedForm(int ErrorCode, User currentUser)
{
this.InitializeComponent();
this._user = currentUser;
this._errorCode = ErrorCode;
}
private void Detail_Click(object sender, EventArgs e)
{
try
{
if (this._user.LoginListner != null)
{
using (LoginFailedLog log = new LoginFailedLog(this._user.LoginListner.LoginLog))
{
log.ShowDialog();
}
}
}
catch
{
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(LoginFailedForm));
this.pnlContainer = new Panel();
this.lbInfo = new XLabel();
this.btnDetail = new XButton();
this.btnOk = new XButton();
this.btnCancel = new XButton();
this.pnlContainer.SuspendLayout();
base.SuspendLayout();
this.pnlContainer.BackColor = Color.Transparent;
this.pnlContainer.Controls.Add(this.lbInfo);
this.pnlContainer.Location = new Point(6, 0x1f);
this.pnlContainer.Name = "pnlContainer";
this.pnlContainer.Size = new Size(0x132, 0x55);
this.pnlContainer.TabIndex = 0;
this.lbInfo.BorderColor = Color.Empty;
this.lbInfo.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbInfo.Location = new Point(7, 14);
this.lbInfo.Name = "lbInfo";
this.lbInfo.Size = new Size(0x124, 0x36);
this.lbInfo.TabIndex = 0;
this.lbInfo.Text = "抱歉,您现在无法登录。可能您的计算机的网络连接有问题{0}。建议您点击下面的\"开始网络诊断\"按钮进行网络连接诊断以帮助您解决问题。";
this.btnDetail.AutoArrangementX = true;
this.btnDetail.AutoSizeToImage = false;
this.btnDetail.BackColor = Color.Transparent;
this.btnDetail.BackgroundImageDisable = null;
this.btnDetail.BackgroundImageDown = null;
this.btnDetail.BackgroundImageHover = null;
this.btnDetail.ChangeSkin = true;
this.btnDetail.Location = new Point(0x88, 0x7a);
this.btnDetail.Name = "btnDetail";
this.btnDetail.Size = new Size(0x4b, 0x17);
this.btnDetail.TabIndex = 2;
this.btnDetail.Text = "详细信息";
this.btnDetail.set_UseVisualStyleBackColor(false);
this.btnDetail.Click += new EventHandler(this.Detail_Click);
this.btnOk.Anchor = AnchorStyles.Top;
this.btnOk.AutoArrangementX = true;
this.btnOk.AutoSizeToImage = false;
this.btnOk.BackColor = Color.Transparent;
this.btnOk.BackgroundImageDisable = null;
this.btnOk.BackgroundImageDown = null;
this.btnOk.BackgroundImageHover = null;
this.btnOk.ChangeSkin = true;
this.btnOk.DialogResult = DialogResult.OK;
this.btnOk.Location = new Point(9, 0x7a);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new Size(0x60, 0x17);
this.btnOk.TabIndex = 1;
this.btnOk.Text = "开始网络诊断";
this.btnOk.set_UseVisualStyleBackColor(false);
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 Point(0xd9, 0x7a);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new Size(0x4b, 0x17);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "取消";
this.btnCancel.set_UseVisualStyleBackColor(false);
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
base.BaseHeight = 240;
base.BaseWidth = 0x149;
base.ClientSize = new Size(0x143, 0xd7);
base.Controls.Add(this.pnlContainer);
base.Controls.Add(this.btnDetail);
base.Controls.Add(this.btnCancel);
base.Controls.Add(this.btnOk);
base.DisplayLocation = new Point(0x12, 0x26);
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.MinimizeBox = false;
base.Name = "LoginFailedForm";
base.set_Padding(new Padding(6, 0x1f, 0x13, 8));
base.Text = "登录失败";
base.Load += new EventHandler(this.LoginFailedForm_Load);
this.pnlContainer.ResumeLayout(false);
base.ResumeLayout(false);
}
private void LoginFailedForm_Load(object sender, EventArgs e)
{
try
{
if (!string.IsNullOrEmpty(this.errorDesc))
{
this.lbInfo.Text = this.errorDesc;
}
else if (this._errorCode > 0)
{
this.lbInfo.Text = string.Format(this.lbInfo.Text, string.Format("(错误号:{0})", this._errorCode.ToString()));
}
else
{
this.lbInfo.Text = string.Format(this.lbInfo.Text, string.Empty);
}
}
catch
{
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -