// -------------------------------------------------------------------------- private void BGWorker_Loading_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) // Method for the backgroundWorker's event triggered used to execute its code { // -------------------------------------------------------------------------- while (true) { BGWorker_Loading.ReportProgress(SplashLoader.SetPercentage); if (SplashLoader.UpdateStatusCircleComplete == true) { break; } Thread.Sleep(100); } // Report the progress as X% // Sleep 100ms }
/// ---------------------------------------------------------------------------------------------------- /// Start the backgroundWorker's Background work || Method for the work the backgroundWorker carries out /// ---------------------------------------------------------------------------------------------------- // ------------------------------------------------------------ private void StartBackgroundWork() // Method to start the background work for the backgroundWorker { // ------------------------------------------------------------ BGWorker_Loading.WorkerReportsProgress = true; // Tell the backgroundWorker to report its progress back. Used for loading bar completion percentage. BGWorker_Loading.RunWorkerAsync(); // Run the worker asynchronously to the rest of the program on a separate thread. }