src/Misc/EFTools/EntityDesign/VisualStudio/ModelWizard/gui/WizardPageSelectTables.cs
// <summary>
//     DoWork event handler: Get table names in a background thread.
//     This method is called by background worker component on a different thread than the UI thread.
//     We use the ModelBuilderEngine to get table names to display
// </summary>
DoWork event handler: Get table names in a background thread.
This method is called by background worker component on a different thread than the UI thread.
We use the ModelBuilderEngine to get table names to display
DoWork event handler : Get table names in a background thread . This method is called by background worker component on a different thread than the UI thread . We use the ModelBuilderEngine to get table names to display
private void bgWorkerPopulateTree_DoWork(object sender, DoWorkEventArgs args)
        {
            using (new VsUtils.HourglassHelper())
            {
                var ssdlAggregator = new DatabaseConnectionSsdlAggregator(Wizard.ModelBuilderSettings);
                var result = new ICollection<EntityStoreSchemaFilterEntry>[3];
                try
                {
                    result[0] = ssdlAggregator.GetTableFilterEntries(args);
                    if (args.Cancel)
                    {
                        return;
                    }
                    result[1] = ssdlAggregator.GetViewFilterEntries(args);
                    if (args.Cancel)
                    {
                        return;
                    }
                    if (Wizard.ModelBuilderSettings.GenerationOption != ModelGenerationOption.CodeFirstFromDatabase)
                    {
                        result[2] = ssdlAggregator.GetFunctionFilterEntries(args);
                    }
                    if (args.Cancel)
                    {
                        return;
                    }
                }
                finally
                {
                    VsUtils.SafeCloseDbConnectionOnFile(
                        Wizard.ModelBuilderSettings.DesignTimeProviderInvariantName, Wizard.ModelBuilderSettings.DesignTimeConnectionString);
                }
                args.Result = result;
            }
        }
private void bgWorkerPopulateTree_DoWork ( object sender , DoWorkEventArgs args ) { using ( new VsUtils . HourglassHelper ( ) ) { var ssdlAggregator = new DatabaseConnectionSsdlAggregator ( Wizard . ModelBuilderSettings ) ; var result = new ICollection < EntityStoreSchemaFilterEntry > [ 3 ] ; try { result [ 0 ] = ssdlAggregator . GetTableFilterEntries ( args ) ; if ( args . Cancel ) { return ; } result [ 1 ] = ssdlAggregator . GetViewFilterEntries ( args ) ; if ( args . Cancel ) { return ; } if ( Wizard . ModelBuilderSettings . GenerationOption != ModelGenerationOption . CodeFirstFromDatabase ) { result [ 2 ] = ssdlAggregator . GetFunctionFilterEntries ( args ) ; } if ( args . Cancel ) { return ; } } finally { VsUtils . SafeCloseDbConnectionOnFile ( Wizard . ModelBuilderSettings . DesignTimeProviderInvariantName , Wizard . ModelBuilderSettings . DesignTimeConnectionString ) ; } args . Result = result ; } }
DoWork event handler: Get table names in a background thread.
DoWork event handler : Get table names in a background thread .
// This method will run on a thread other than the UI thread. // Be sure not to manipulate any Windows Forms controls created on the UI thread from this method. // we don't support function imports in CodeFirst so don't have to retrieve them
sender
object
args
DoWorkEventArgs