?? 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 int _errorCode;
private User _user;
private XButton btnCancel;
private XButton btnDetail;
private XButton btnOk;
private IContainer components;
private XLabel lbInfo;
private Panel pnlContainer;
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()
{
this.components = new Container();
ComponentResourceManager manager = new ComponentResourceManager(typeof(LoginFailedForm));
this.pnlContainer = new Panel();
this.btnDetail = new XButton();
this.lbInfo = new XLabel();
this.btnOk = new XButton();
this.btnCancel = new XButton();
this.pnlContainer.SuspendLayout();
base.SuspendLayout();
base.MinimizeBox = false;
this.pnlContainer.BackColor = Color.Transparent;
this.pnlContainer.Controls.Add(this.btnDetail);
this.pnlContainer.Controls.Add(this.lbInfo);
this.pnlContainer.Controls.Add(this.btnOk);
this.pnlContainer.Controls.Add(this.btnCancel);
this.pnlContainer.Dock = DockStyle.Fill;
this.pnlContainer.Location = new Point(6, 0x1f);
this.pnlContainer.Name = "pnlContainer";
this.pnlContainer.Size = new Size(0x132, 0x85);
this.pnlContainer.TabIndex = 0;
this.btnDetail.Location = new Point(0x81, 90);
this.btnDetail.Name = "btnDetail";
this.btnDetail.Size = new Size(0x4b, 0x17);
this.btnDetail.TabIndex = 2;
this.btnDetail.Text = "詳細信息";
this.btnDetail.UseVisualStyleBackColor = true;
this.btnDetail.Click += new EventHandler(this.Detail_Click);
this.lbInfo.BorderColor = Color.Empty;
this.lbInfo.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbInfo.Location = new Point(11, 0x13);
this.lbInfo.Name = "lbInfo";
this.lbInfo.Size = new Size(0x124, 0x45);
this.lbInfo.TabIndex = 0;
this.lbInfo.Text = "抱歉,您現在無法登錄。可能您的計算機的網絡連接有問題{0}。建議您點擊下面的\"開始網絡診斷\"按鈕進行網絡連接診斷以幫助您解決問題。";
this.btnOk.DialogResult = DialogResult.OK;
this.btnOk.Location = new Point(0x1b, 90);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new Size(0x60, 0x17);
this.btnOk.TabIndex = 1;
this.btnOk.Text = "開始網絡診斷";
this.btnOk.UseVisualStyleBackColor = true;
this.btnCancel.DialogResult = DialogResult.Cancel;
this.btnCancel.Location = new Point(210, 90);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new Size(0x4b, 0x17);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
base.AcceptButton = this.btnOk;
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.CancelButton = this.btnCancel;
base.ClientSize = new Size(0x14b, 0xac);
base.Controls.Add(this.pnlContainer);
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.Name = "LoginFailedForm";
base.Padding = new Padding(6, 0x1f, 0x13, 8);
base.Text = "登錄失敗";
base.Load += new EventHandler(this.LoginFailedForm_Load);
base.Controls.SetChildIndex(this.pnlContainer, 0);
base.Controls.SetChildIndex(base.menubar, 0);
this.pnlContainer.ResumeLayout(false);
base.ResumeLayout(false);
}
private void LoginFailedForm_Load(object sender, EventArgs e)
{
try
{
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 + -