private void DelayOperations(object background) { if ((bool)background) { customTabControl1.Visible = false; System.Threading.ThreadPool.QueueUserWorkItem(DelayOperations, false); return; } System.Threading.Thread.Sleep(200); this.BeginInvoke((MethodInvoker)delegate { //add controls AddControls(); customTabControl1.Visible = true; this.Cursor = Cursors.Default; Logger.Add("Initialized all controls", "Main Form"); loadingPanel.Visible = false; //set some properties to the form SetFormProperties(); }); //initialize controls and add them if (LocalDatabase.UpdateAll()) { LocalDatabase.LoadDatabase(); } //check for update if (Properties.Settings.Default.CheckForUpdate) { System.Threading.Thread.Sleep(5000); UpdateCheck.CheckForUpdate(); } }
private void refreshDatabaseToolStripMenuItem_Click(object sender, EventArgs e) { LocalDatabase.LoadDatabase(); }