src/Misc/EFTools/EntityDesign/VisualStudio/ModelWizard/gui/WizardPageSelectTables.cs
// <summary>
//     Invoked by the VS Wizard framework when this page is entered.
//     Starts a background thread to retrieve table information to display
// </summary>
Invoked by the VS Wizard framework when this page is entered.
Starts a background thread to retrieve table information to display
Invoked by the VS Wizard framework when this page is entered . Starts a background thread to retrieve table information to display
public override void OnActivated()
        {
            base.OnActivated();
            SetControlState(Wizard.ModelBuilderSettings.GenerationOption == ModelGenerationOption.CodeFirstFromDatabase);
            Debug.Assert(
                Wizard.ModelBuilderSettings.DesignTimeConnectionString != null,
                "Unexpected null value for connection string");
            if ((Wizard.ModelBuilderSettings.GenerationOption == ModelGenerationOption.GenerateFromDatabase ||
                Wizard.ModelBuilderSettings.GenerationOption == ModelGenerationOption.CodeFirstFromDatabase)
                && (!Wizard.ModelBuilderSettings.DesignTimeConnectionString.Equals(_initializedDataConnection) ||
                    Wizard.ModelBuilderSettings.UseLegacyProvider != _initializedUsingLegacyProvider ||
                    Wizard.ModelBuilderSettings.GenerationOption != _initializedGenerationOption))
            {
                databaseObjectTreeView.Visible = true;
                labelPrompt.Visible = true;
                Wizard.EnableButton(ButtonType.Previous, false);
                Wizard.EnableButton(ButtonType.Next, false);
                Wizard.EnableButton(ButtonType.Finish, false);
                modelNamespaceTextBox.Enabled = false;
                Wizard.ModelBuilderSettings.DatabaseObjectFilters = null;
                databaseObjectTreeView.TreeViewControl.Nodes.Clear();
                databaseObjectTreeView.ShowStatus(ModelWizard.Properties.Resources.SelectTablesPage_StatusRetrievingTablesText);
                _stopwatch.Reset();
                _stopwatch.Start();
                _bgWorkerPopulateTree.RunWorkerAsync(this);
            }
        }
public override void OnActivated ( ) { base . OnActivated ( ) ; SetControlState ( Wizard . ModelBuilderSettings . GenerationOption == ModelGenerationOption . CodeFirstFromDatabase ) ; Debug . Assert ( Wizard . ModelBuilderSettings . DesignTimeConnectionString != null , " " ) ; if ( ( Wizard . ModelBuilderSettings . GenerationOption == ModelGenerationOption . GenerateFromDatabase || Wizard . ModelBuilderSettings . GenerationOption == ModelGenerationOption . CodeFirstFromDatabase ) && ( ! Wizard . ModelBuilderSettings . DesignTimeConnectionString . Equals ( _initializedDataConnection ) || Wizard . ModelBuilderSettings . UseLegacyProvider != _initializedUsingLegacyProvider || Wizard . ModelBuilderSettings . GenerationOption != _initializedGenerationOption ) ) { databaseObjectTreeView . Visible = true ; labelPrompt . Visible = true ; Wizard . EnableButton ( ButtonType . Previous , false ) ; Wizard . EnableButton ( ButtonType . Next , false ) ; Wizard . EnableButton ( ButtonType . Finish , false ) ; modelNamespaceTextBox . Enabled = false ; Wizard . ModelBuilderSettings . DatabaseObjectFilters = null ; databaseObjectTreeView . TreeViewControl . Nodes . Clear ( ) ; databaseObjectTreeView . ShowStatus ( ModelWizard . Properties . Resources . SelectTablesPage_StatusRetrievingTablesText ) ; _stopwatch . Reset ( ) ; _stopwatch . Start ( ) ; _bgWorkerPopulateTree . RunWorkerAsync ( this ) ; } }
Invoked by the VS Wizard framework when this page is entered.
Invoked by the VS Wizard framework when this page is entered .
// Enable the treeView / labels and hide the database project label and textbox. // Disable wizard navigation temporarily until the background thread completes // disable model namespace textbox // Clear existing database objects // Put up a status message // Get table names in a background thread