| | |
| | | using AutoUpdaterDotNET; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraRichEdit.Export.Rtf; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.Properties; |
| | | using Gs.DevApp.ToolBox; |
| | |
| | | { |
| | | public partial class FrmLogin : XtraForm |
| | | { |
| | | private string _productName = ""; |
| | | private string _version = "未知"; |
| | | private string _strFont = ""; |
| | | private string _webApiUrl = ""; |
| | | public FrmLogin() |
| | | { |
| | | |
| | | InitializeComponent(); |
| | | _productName = ConfigurationManager.AppSettings["ProductName"]; |
| | | _webApiUrl = ConfigurationManager.AppSettings["WebApiUrl"]; |
| | | if (ConfigurationManager.AppSettings["IsAutoUpdater"] == "1") |
| | | _autoUpdate(); |
| | | _getFont(); |
| | | _getRemember(); |
| | | Text = lbVersion.Text = ConfigurationManager.AppSettings["ProductName"]; |
| | | btnLogin.Click += BtnLogin_Click; |
| | | btnCancel.Click += BtnCancel_Click; |
| | | |
| | | lbVersion.Text = _productName+ ",版本(" + _version + ")" + ",使用字体(" + _strFont + ")"+",服务地址("+ _webApiUrl + ")"; |
| | | } |
| | | |
| | | private void BtnCancel_Click(object sender, EventArgs e) |
| | |
| | | { |
| | | try |
| | | { |
| | | string strFont = Settings.Default.fontSizeName; |
| | | if (string.IsNullOrEmpty(strFont)) |
| | | _strFont = Settings.Default.fontSizeName; |
| | | if (string.IsNullOrEmpty(_strFont)) |
| | | return; |
| | | string[] ary = strFont.Split(','); |
| | | string[] ary = _strFont.Split(','); |
| | | if (ary.Length < 2) |
| | | return; |
| | | float _ft = float.Parse(ary[1]); |
| | |
| | | DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont = new System.Drawing.Font(ary[0], _ft); |
| | | DevExpress.XtraEditors.WindowsFormsSettings.DefaultPrintFont = new System.Drawing.Font(ary[0], _ft); |
| | | #endregion |
| | | |
| | | } |
| | | catch (Exception) |
| | | { |
| | |
| | | } |
| | | private void _autoUpdate() |
| | | { |
| | | var _version = ConfigurationManager.AppSettings["Version"]; |
| | | _version = ConfigurationManager.AppSettings["Version"]; |
| | | AutoUpdater.InstalledVersion = new Version(_version); |
| | | AutoUpdater.Start(ConfigurationManager.AppSettings["AutoUpdaterXml"]); |
| | | AutoUpdater.CheckForUpdateEvent += AutoUpdater_CheckForUpdateEvent; |