/// <summary> /// The work handler function for the background worker /// </summary> /// <param name="sender">event sender</param> /// <param name="e">event args</param> private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { var appName = _line1 ?? String.Empty; var appVersion = _line2 ?? String.Empty; var appCopyright = _line3 ?? String.Empty; _form = new SplashScreen(appName, appVersion, appCopyright, _image); _closeEvent.Set(); _form.ShowDialog(); if (_form != null) { _form.Dispose(); } }
/// <summary> /// Call this to dismiss the splash screen /// </summary> public void Close() { try { waitUntilUpTime(); if (_form != null) { _form.Dismiss(); _form = null; } if (_backgroundWorker != null) { _backgroundWorker.CancelAsync(); _backgroundWorker.Dispose(); _backgroundWorker = null; } } catch { } }