private void frmMain_Load(object sender, EventArgs e) { CurrentInternalReport.Load(); if (!ApplicationClosing) { dockPanel.SuspendLayout(); string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config"); if (File.Exists(configFile)) { dockPanel.LoadFromXml(configFile, m_deserializeDockContent); } lblPendingReports.Text = DBHelper.GetPendingReportCount(); lblUsersOnline.Text = DBHelper.GetUsersOnlineCount(); dockPanel.ResumeLayout(); Task tStart = new Task(() => Start()); tStart.Start(); } else { Application.Exit(); } }
private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { dbHelper.LogOff(); CurrentInternalReport.Save(); string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config"); if (bSaveLayout) { dockPanel.SaveAsXml(configFile); } else if (File.Exists(configFile)) { File.Delete(configFile); } }