Forex_Strategy_Builder.Dialogs.Generator.Generator.BgWorker_RunWorkerCompleted C# (CSharp) Method

BgWorker_RunWorkerCompleted() private method

This event handler deals with the results of the background operation
private BgWorker_RunWorkerCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void
sender object
e System.ComponentModel.RunWorkerCompletedEventArgs
return void
        void BgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (!e.Cancelled && Configs.PlaySounds)
                System.Media.SystemSounds.Exclamation.Play();

            RestoreFromBest();

            Backtester.Calculate();
            Backtester.CalculateAccountStats();

            smallBalanceChart.SetChartData();
            smallBalanceChart.InitChart();
            smallBalanceChart.Invalidate();

            strategyLayout.Enabled = true;
            RebuildStrategyLayout(strategyBest);

            isGenerating = false;

            btnAccept.Enabled = true;
            btnCancel.Enabled = true;

            foreach (Control control in pnlCommon.Controls)
                control.Enabled = true;
            foreach (Control control in pnlLimitations.Controls)
                control.Enabled = true;
            foreach (Control control in pnlSettings.Controls)
                control.Enabled = true;

            indicatorsLayout.UnblockIndikatorChange();

            tsbtLockAll.Enabled      = true;
            tsbtUnlockAll.Enabled    = true;
            tsbtLinkAll.Enabled      = true;
            tsbtOverview.Enabled     = true;
            tsbtStrategyInfo.Enabled = true;

            btnGenerate.Text  = Language.T("Generate");
            progressBar.Style = ProgressBarStyle.Blocks;

            Cursor = Cursors.Default;

            return;
        }