⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssgeneralcontrol.cs

📁 飞信的收发使用csharp进行开发
💻 CS
📖 第 1 页 / 共 2 页
字号:
            this.ctlAutoHideSeconds.Name = "ctlAutoHideSeconds";
            this.ctlAutoHideSeconds.Size = new Size(0x30, 0x15);
            this.ctlAutoHideSeconds.TabIndex = 3;
            int[] numArray3 = new int[4];
            numArray3[0] = 30;
            this.ctlAutoHideSeconds.Value = new decimal(numArray3);
            this.ctlAutoHideSeconds.Visible = false;
            this.lbAutoHide.AutoSize = true;
            this.lbAutoHide.BorderColor = Color.Empty;
            this.lbAutoHide.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lbAutoHide.Location = new Point(0xa3, 0x26);
            this.lbAutoHide.Name = "lbAutoHide";
            this.lbAutoHide.Size = new Size(0x41, 12);
            this.lbAutoHide.TabIndex = 4;
            this.lbAutoHide.Text = "lbAutoHide";
            this.lbAutoHide.UseMnemonic = false;
            this.lbAutoHide.Visible = false;
            this.ctlTopMost.AutoSize = true;
            this.ctlTopMost.Location = new Point(20, 0x133);
            this.ctlTopMost.Name = "ctlTopMost";
            this.ctlTopMost.Size = new Size(0x54, 0x10);
            this.ctlTopMost.TabIndex = 10;
            this.ctlTopMost.Text = "ctlTopMost";
            this.ctlTopMost.UseVisualStyleBackColor = true;
            this.panelImprove.Controls.Add(label3);
            this.panelImprove.Controls.Add(this.checkBoxImprove);
            this.panelImprove.Controls.Add(label4);
            this.panelImprove.Location = new Point(1, 0x9b);
            this.panelImprove.Name = "panelImprove";
            this.panelImprove.Size = new Size(360, 0x2e);
            this.panelImprove.TabIndex = 0x10;
            this.checkBoxImprove.AutoSize = true;
            this.checkBoxImprove.Location = new Point(0x11, 0x16);
            this.checkBoxImprove.Name = "checkBoxImprove";
            this.checkBoxImprove.Size = new Size(0xe4, 0x10);
            this.checkBoxImprove.TabIndex = 13;
            this.checkBoxImprove.Text = "允许记录操作日志,以改善用户体验。";
            this.checkBoxImprove.UseVisualStyleBackColor = true;
            base.Controls.Add(this.panelImprove);
            base.Controls.Add(this.ctlTopMost);
            base.Controls.Add(this.lbAutoHide);
            base.Controls.Add(this.ctlAutoHideSeconds);
            base.Controls.Add(this.ctlAutoLogin);
            base.Controls.Add(this.ctlAutoStartup);
            base.Controls.Add(this.ctlPopupMainWnd);
            base.Controls.Add(this.ctlAutoHide);
            base.Controls.Add(this.lbLogin);
            base.Controls.Add(label2);
            base.Controls.Add(this.lbWnd);
            base.Controls.Add(label);
            base.Name = "SsGeneralControl";
            base.Size = new Size(0x16b, 400);
            base.DoubleClick += new EventHandler(this.SsGeneralControl_DoubleClick);
            base.Load += new EventHandler(this.SsGeneralControl_Load);
            this.ctlAutoHideSeconds.EndInit();
            this.panelImprove.ResumeLayout(false);
            this.panelImprove.PerformLayout();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void SsGeneralControl_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                if ((Imps.Client.Utils.Win32.NativeMethods.GetKeyState(0x11) & 0x8000) != 0)
                {
                    this.panelImprove.Visible = true;
                }
            }
            catch
            {
            }
        }

        private void SsGeneralControl_Load(object sender, EventArgs e)
        {
            this.lbWnd.Text = StringTable.GerneralSetting.LbWindows;
            this.ctlTopMost.Text = StringTable.GerneralSetting.CkTopMost;
            this.ctlAutoHide.Text = StringTable.GerneralSetting.CkAutoHide;
            this.ctlPopupMainWnd.Text = StringTable.GerneralSetting.CkPopupMainWnd;
            this.lbLogin.Text = StringTable.GerneralSetting.LbLogin;
            this.ctlAutoStartup.Text = StringTable.GerneralSetting.CkAutoStartup;
            this.ctlAutoLogin.Text = StringTable.GerneralSetting.CkAutoLogin;
            this.lbAutoHide.Text = StringTable.GerneralSetting.lbAutoHide;
            this.ctlAutoHideSeconds.Left = this.ctlAutoHide.Right;
            this.ctlAutoHideSeconds.OnValueOutOfRange += new EventHandler(this.ctlAutoHideSeconds_OnValueOutOfRange);
            this.lbAutoHide.Left = this.ctlAutoHideSeconds.Right;
            this.ctlTopMost.Visible = false;
            int num = this.ctlAutoHide.Top - this.ctlTopMost.Top;
            foreach (Control control in base.Controls)
            {
                if (control.Top > this.ctlTopMost.Top)
                {
                    control.Top -= num;
                }
            }
            this.panelImprove.Visible = false;
        }

        private void uiData_Changed(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                base.Modified = true;
            });
        }

        public override bool UpdateData(bool update)
        {
            Imps.Client.Core.MainWindowSetting mainWindowSetting = this.CurrentUser.Configuration.UserSetting.MainWindowSetting;
            if (update)
            {
                if (!this.CheckUserInput())
                {
                    return false;
                }
                Suspender suspender = new Suspender(mainWindowSetting);
                try
                {
                    mainWindowSetting.TopMost = this.ctlTopMost.Visible && this.ctlTopMost.Checked;
                    mainWindowSetting.AutoHide = this.ctlAutoHide.Checked;
                    mainWindowSetting.AutoHideSeconds = Convert.ToInt32(this.ctlAutoHideSeconds.Value);
                    if (this.ctlAutoLogin.Enabled)
                    {
                        UserAccounts.LatestAccountAutoLogin = this.ctlAutoLogin.Checked;
                    }
                    if (this.ctlAutoStartup.Checked)
                    {
                        RegistryHelper.RegStartUp(Imps.Client.Core.Configuration.FixedClientSetting.AppEnglishName, this._frameworkWnd.MainAppPath);
                    }
                    else
                    {
                        RegistryHelper.UnregStartUp(Imps.Client.Core.Configuration.FixedClientSetting.AppEnglishName);
                    }
                    UserAccounts.LatestAccountAutoLogin = this.ctlAutoLogin.Checked;
                    try
                    {
                        ((EntryPointControl) this._frameworkWnd.AccountManager.EntryPointControl).AutoLogin = this.ctlAutoLogin.Checked;
                    }
                    catch (Exception)
                    {
                    }
                    this.CurrentUser.Configuration.SystemSetting.RecordMyLog = this.checkBoxImprove.Checked;
                    mainWindowSetting.AutoPopup = this.ctlPopupMainWnd.Checked;
                }
                finally
                {
                    suspender.Dispose();
                }
            }
            else
            {
                this.ctlTopMost.Checked = mainWindowSetting.TopMost;
                this.ctlAutoHide.Checked = mainWindowSetting.AutoHide;
                this.ctlAutoHideSeconds.Enabled = mainWindowSetting.AutoHide;
                this.ctlAutoHideSeconds.Value = Convert.ToDecimal(mainWindowSetting.AutoHideSeconds);
                this.ctlAutoLogin.Enabled = (this._frameworkWnd.AccountManager.CurrentUser.Status == UserAccountStatus.Logon) && UserAccounts.AutoLoginEnabled;
                this.ctlAutoLogin.Checked = this.ctlAutoLogin.Enabled && UserAccounts.LatestAccountAutoLogin;
                this.ctlAutoStartup.Checked = RegistryHelper.IsAppStartUp(Imps.Client.Core.Configuration.FixedClientSetting.AppEnglishName, this._frameworkWnd.MainAppPath);
                this.ctlPopupMainWnd.Checked = mainWindowSetting.AutoPopup;
                this.checkBoxImprove.Checked = this.CurrentUser.Configuration.SystemSetting.RecordMyLog;
            }
            base.Modified = false;
            return true;
        }

        private Imps.Client.Core.User CurrentUser
        {
            get
            {
                return this._frameworkWnd.AccountManager.CurrentUser;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -