src/Misc/EFTools/EntityDesign/VisualStudio/ModelWizard/engine/ProgressDialogHelper.cs
// <summary>
//     This method run on the background thread behind a ProgressDialog.
//     For each filter entry in newFunctionFilterEntries log on to the database, gather the return type
//     information and store the result in ModelBuilderSettings
// </summary>
This method run on the background thread behind a ProgressDialog.
For each filter entry in newFunctionFilterEntries log on to the database, gather the return type
information and store the result in ModelBuilderSettings
This method run on the background thread behind a ProgressDialog . For each filter entry in newFunctionFilterEntries log on to the database gather the return type information and store the result in ModelBuilderSettings
private static object GatherAndStoreSchemaProcedureInformation(BackgroundWorker worker, DoWorkEventArgs e)
        {
            if (null == worker)
            {
                throw new ProgressDialogException(
                    string.Format(
                        CultureInfo.CurrentCulture, Design.Resources.RetrievingSprocReturnTypeErrorMessage, "null BackgroundWorker"));
            }
            var arg = e.Argument as GatherAndReturnSprocInfo;
            if (null == arg)
            {
                throw new ProgressDialogException(
                    string.Format(
                        CultureInfo.CurrentCulture, Design.Resources.RetrievingSprocReturnTypeErrorMessage, "null DoWorkEventArgs"));
            }
            var newFunctionFilterEntries = arg.NewFunctionEntries;
            if (null == newFunctionFilterEntries)
            {
                throw new ProgressDialogException(
                    string.Format(
                        CultureInfo.CurrentCulture, Design.Resources.RetrievingSprocReturnTypeErrorMessage, "null newFunctionFilterEntries"));
            }
            var modelBuilderSettings = arg.ModelBuilderSettings;
            if (null == modelBuilderSettings)
            {
                throw new ProgressDialogException(
                    string.Format(
                        CultureInfo.CurrentCulture, Design.Resources.RetrievingSprocReturnTypeErrorMessage, "null modelBuilderSettings"));
            }
            modelBuilderSettings.NewFunctionSchemaProcedures.Clear();
            foreach (var entry in newFunctionFilterEntries)
            {
                modelBuilderSettings.NewFunctionSchemaProcedures.Add(entry, null);
            }
            PopulateNewFunctionSchemaProcedures(
                modelBuilderSettings.NewFunctionSchemaProcedures,
                modelBuilderSettings.DesignTimeProviderInvariantName,
                modelBuilderSettings.DesignTimeConnectionString,
                e,
                worker);
            return null;
        }
private static object GatherAndStoreSchemaProcedureInformation ( BackgroundWorker worker , DoWorkEventArgs e ) { if ( null == worker ) { throw new ProgressDialogException ( string . Format ( CultureInfo . CurrentCulture , Design . Resources . RetrievingSprocReturnTypeErrorMessage , " " ) ) ; } var arg = e . Argument as GatherAndReturnSprocInfo ; if ( null == arg ) { throw new ProgressDialogException ( string . Format ( CultureInfo . CurrentCulture , Design . Resources . RetrievingSprocReturnTypeErrorMessage , " " ) ) ; } var newFunctionFilterEntries = arg . NewFunctionEntries ; if ( null == newFunctionFilterEntries ) { throw new ProgressDialogException ( string . Format ( CultureInfo . CurrentCulture , Design . Resources . RetrievingSprocReturnTypeErrorMessage , " " ) ) ; } var modelBuilderSettings = arg . ModelBuilderSettings ; if ( null == modelBuilderSettings ) { throw new ProgressDialogException ( string . Format ( CultureInfo . CurrentCulture , Design . Resources . RetrievingSprocReturnTypeErrorMessage , " " ) ) ; } modelBuilderSettings . NewFunctionSchemaProcedures . Clear ( ) ; foreach ( var entry in newFunctionFilterEntries ) { modelBuilderSettings . NewFunctionSchemaProcedures . Add ( entry , null ) ; } PopulateNewFunctionSchemaProcedures ( modelBuilderSettings . NewFunctionSchemaProcedures , modelBuilderSettings . DesignTimeProviderInvariantName , modelBuilderSettings . DesignTimeConnectionString , e , worker ) ; return null ; }
This method run on the background thread behind a ProgressDialog.
This method run on the background thread behind a ProgressDialog .
// clear map first (if user has clicked backwards and forwards between wizard pages this can already be populated) // now set-up Dictionary with all EntityStoreSchemaFilterEntry keys but all pointing to null values // if the process is interrupted then those that still have null values represent sprocs which // need to be deleted
worker
BackgroundWorker
e
DoWorkEventArgs