📄 entrypointcontrol.cs
字号:
int num7 = (width - 160) / 2;
x += num7;
num3 -= num7;
width = 160;
}
int num8 = x;
int num9 = y - 6;
int num4 = y;
this.cmbId.SetBounds(x, num4 - 6, width, 0, BoundsSpecified.Width | BoundsSpecified.Location);
if (x != this.cmbId.Left)
{
win32api_wrapper.MoveWindow(this.cmbId.Handle, x, num4 - 6, width, this.cmbId.Height, true);
}
y = ((num9 + this.cmbId.Height) + 6) + 1;
int num5 = y;
this.tbPassword.SetBounds(x, num5, width, 0, BoundsSpecified.Width | BoundsSpecified.Location);
y = this.tbPassword.Bottom + 15;
this.InitStatus.SetBounds(this.pbPortrait.Right - this.InitStatus.Width, this.pbPortrait.Bottom + 3, 0, 0, BoundsSpecified.Location);
if (flag2)
{
x += width + 5;
this.llProvisioning.SetBounds(x, num9 + ((this.cmbId.Height - this.llProvisioning.Height) / 2), 0, 0, BoundsSpecified.Location);
this.llForgetPass.SetBounds(x, this.tbPassword.Top + ((this.tbPassword.Height - this.llForgetPass.Height) / 2), 0, 0, BoundsSpecified.Location);
}
if (flag4)
{
y = this.tbPassword.Bottom + 0x24;
x = num8;
int num10 = (x + ((int) ((num3 - x) * 0.5))) - (this.btnLogin.Width / 2);
x = (num3 - 0x18) - this.btnLogin.Width;
if (num10 < x)
{
x = num10;
}
this.lblStep.SetBounds(x, (y - this.pbProgress.Height) - 3, 0, 0, BoundsSpecified.Location);
y += (this.tbPassword.Height + 3) + 3;
this.btnLogin.SetBounds(x - 5, y, 0, 0, BoundsSpecified.Location);
this.pbProgress.Location = new System.Drawing.Point(((base.Width - this.pbProgress.Width) / 2) - 5, (y - this.pbProgress.Height) - 3);
y = (this.btnLogin.Bottom + 3) + 3;
x += (this.btnLogin.Width - this.llNetSetting.Width) / 2;
this.llNetSetting.SetBounds(x, y, 0, 0, BoundsSpecified.Location);
this.llReconnectAtOnce.SetBounds(x, y, 0, 0, BoundsSpecified.Location);
}
if (flag3)
{
x = num8 + 0x18;
y = clientSize.Height - this.cbAutoLogin.Height;
this.cbSaveAccount.SetBounds(x, y, 0, 0, BoundsSpecified.Location);
y -= this.cbSavePassword.Height + 3;
this.cbAutoLogin.SetBounds(x, y, 0, 0, BoundsSpecified.Location);
y -= this.cbSaveAccount.Height + 3;
this.cbSavePassword.SetBounds(x, y, 0, 0, BoundsSpecified.Location);
x = num8;
y -= this.rbPrivate.Height + 3;
this.rbPrivate.SetBounds(x, y, 0, 0, BoundsSpecified.Location);
y -= this.rbPublic.Height + 3;
this.rbPublic.SetBounds(x, y, 0, 0, BoundsSpecified.Location);
if (flag2)
{
this.llEraseInfo.SetBounds(this.rbPrivate.Right + 20, this.rbPrivate.Top + 3, 0, 0, BoundsSpecified.Location);
this.llEraseInfo.Visible = this.llEraseInfo.Right < (base.Width - 0x18);
}
}
}
catch
{
}
finally
{
base.ResumeLayout(false);
}
}
private void ResetCheckBox()
{
this.rbPrivate.Checked = true;
this.cbSaveAccount.Checked = true;
this.cbSavePassword.Checked = true;
this.cbAutoLogin.Checked = true;
}
private void ShowErrorTip(string text, Control ctrl)
{
if (ctrl is TextBoxBase)
{
((TextBoxBase) ctrl).SelectAll();
}
else if (ctrl is ComboBox)
{
((ComboBox) ctrl).SelectAll();
}
ctrl.Focus();
BalloonHelper.ShowBallon(ctrl, text, StringTable.User.MsgErrorTitle, 3, new System.Drawing.Point(10, 5), 0x7d0);
}
private void ShowNetworkSetting(bool show)
{
this.llNetSetting.Visible = show;
this.llReconnectAtOnce.Visible = !show && NetworkInterface.GetIsNetworkAvailable();
}
private static void SortIds(string[] ids)
{
int length = ids.Length;
for (int i = 0; i < (length - 1); i++)
{
int num1 = ids[i].Length;
for (int j = i + 1; j < length; j++)
{
if (CompareIds(ids[i], ids[j]) > 0)
{
string text = ids[i];
ids[i] = ids[j];
ids[j] = text;
}
}
}
}
private void StartReconnect()
{
if (this.autoReconnect.NextInterval > 0)
{
ClientLogger.WriteGeneral("开始自动重连!");
this._manager.CurrentUser.Status = UserAccountStatus.WaitReconnect;
this.autoReconnect.StartTimer();
}
}
private void tbPassword_TextChanged(object sender, EventArgs e)
{
try
{
this.EnableControls(this.cmbId.Enabled);
}
catch
{
}
}
private void TryAutoLogin()
{
if ((this.cbAutoLogin.Checked && (this.cmbId.Text.Length > 0)) && (this.tbPassword.Text.Length > 0))
{
this.DoLogin(true);
}
}
private void TryFillRelatedInfo()
{
try
{
this._causedByUser = false;
base.SuspendLayout();
this.HideErrorTip();
string id = this.cmbId.Text;
UserAccounts.AccountData account = UserAccounts.GetAccount(id);
bool flag = null != account;
this.TryLoadPortrait(flag ? account.Id : null);
if (flag)
{
this.rbPrivate.Checked = true;
this.cbSaveAccount.Checked = true;
this.tbPassword.Text = account.Password;
bool flag2 = !string.IsNullOrEmpty(account.Password);
this.cbSavePassword.Checked = flag2;
this.cbAutoLogin.Checked = flag2 && account.AutoLogin;
try
{
this._initPresence = (MainPresence) Enum.Parse(typeof(MainPresence), account.PresenceValue.ToString());
}
catch (Exception exception)
{
ClientLogger.WriteException("设置_initPresence 执行出错", exception);
}
}
else if (id.Length <= 0)
{
this.tbPassword.Text = string.Empty;
}
else if (IsIdCompleted(id) || this.tbPassword.AutoInputed)
{
this.tbPassword.Text = string.Empty;
}
this.InitStatus.OnlineStatusText = MainPresenceHelper.MainPresence2Str(this._initPresence);
}
catch (Exception exception2)
{
ClientLogger.WriteException("TryFillRelatedInfo 方法执行出错", exception2);
}
finally
{
base.ResumeLayout(false);
this._causedByUser = true;
}
}
private void TryLoadPortrait(string id)
{
Image objB = null;
long userId;
if (!string.IsNullOrEmpty(id) && long.TryParse(id, ref userId))
{
if (userId >= 0x2540be400)
{
userId = UserAccounts.GetMappedSid(userId.ToString());
}
if (userId > 0)
{
IicUri uri = IicUri.CreateSidUri((long) ((int) userId));
try
{
if (this._manager.CurrentUser != null)
{
int crc;
this._manager.FrameworkWnd.PersistentManager.LoadById(userId);
objB = this._manager.FrameworkWnd.PersistentManager.LoadPortrait(uri, out crc);
}
}
catch
{
}
}
}
if (objB == null)
{
objB = this.DefaultPortrait;
}
if (!object.Equals(this._curPortrait, objB))
{
this._curPortrait = objB;
ControlHelper.FadeinImage(this.pbPortrait, objB);
}
}
private void UpdateStepLabelText(string newLabelText)
{
this.lblStep.Text = newLabelText;
}
public bool AutoLogin
{
get
{
return this.cbAutoLogin.Checked;
}
set
{
this.cbAutoLogin.Checked = value;
}
}
public string CurrentId
{
get
{
return this.cmbId.Text;
}
set
{
if (value != string.Empty)
{
this.cmbId.Text = value;
}
}
}
public Image DefaultPortrait
{
get
{
if (this._defaultPortrait == null)
{
this._defaultPortrait = ImpsPortrait.GetDefaultPortrait(0x60, 0x60);
}
return this._defaultPortrait;
}
}
public string InitStatusText
{
get
{
return this.InitStatus.OnlineStatusText;
}
}
private int WidthMaxProvisioning
{
get
{
return Math.Max(this.llProvisioning.Width, this.llForgetPass.Width);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -