src/Misc/EFTools/EntityDesign/VisualStudio/ModelWizard/gui/WizardPageDbConfig.cs
// <summary>
//     Helper to update ModelBuilderSettings from GUI
//     TODO: validate settings on this page are correct
// </summary>
Helper to update ModelBuilderSettings from GUI
TODO: validate settings on this page are correct
Helper to update ModelBuilderSettings from GUI TODO : validate settings on this page are correct
private void UpdateSettingsFromGui()
        {
            if (_dataConnection == null)
            {
                return;
            }
            var decryptedConnectionString = DataConnectionUtils.DecryptConnectionString(_dataConnection);
            var appConfigConnectionString = String.Empty;
            if (checkBoxSaveInAppConfig.Enabled
                && checkBoxSaveInAppConfig.Checked)
            {
                Wizard.ModelBuilderSettings.SaveConnectionStringInAppConfig = true;
                Wizard.ModelBuilderSettings.AppConfigConnectionPropertyName = textBoxAppConfigConnectionName.Text;
                if (allowSensitiveInfoButton.Checked)
                {
                    appConfigConnectionString = decryptedConnectionString;
                }
                else
                {
                    appConfigConnectionString = _dataConnection.SafeConnectionString;
                }
            }
            else
            {
                Wizard.ModelBuilderSettings.SaveConnectionStringInAppConfig = false;
                Wizard.ModelBuilderSettings.AppConfigConnectionPropertyName = string.Empty;
            }
            Wizard.ModelBuilderSettings.InitialCatalog = DataConnectionUtils.GetInitialCatalog(_dataProviderManager, _dataConnection);
            var invariantName = DataConnectionUtils.GetProviderInvariantName(_dataProviderManager, _dataConnection.Provider);
            Wizard.ModelBuilderSettings.SetInvariantNamesAndConnectionStrings(ServiceProvider,
                Wizard.Project, invariantName, decryptedConnectionString, appConfigConnectionString, true);
        }
private void UpdateSettingsFromGui ( ) { if ( _dataConnection == null ) { return ; } var decryptedConnectionString = DataConnectionUtils . DecryptConnectionString ( _dataConnection ) ; var appConfigConnectionString = String . Empty ; if ( checkBoxSaveInAppConfig . Enabled && checkBoxSaveInAppConfig . Checked ) { Wizard . ModelBuilderSettings . SaveConnectionStringInAppConfig = true ; Wizard . ModelBuilderSettings . AppConfigConnectionPropertyName = textBoxAppConfigConnectionName . Text ; if ( allowSensitiveInfoButton . Checked ) { appConfigConnectionString = decryptedConnectionString ; } else { appConfigConnectionString = _dataConnection . SafeConnectionString ; } } else { Wizard . ModelBuilderSettings . SaveConnectionStringInAppConfig = false ; Wizard . ModelBuilderSettings . AppConfigConnectionPropertyName = string . Empty ; } Wizard . ModelBuilderSettings . InitialCatalog = DataConnectionUtils . GetInitialCatalog ( _dataProviderManager , _dataConnection ) ; var invariantName = DataConnectionUtils . GetProviderInvariantName ( _dataProviderManager , _dataConnection . Provider ) ; Wizard . ModelBuilderSettings . SetInvariantNamesAndConnectionStrings ( ServiceProvider , Wizard . Project , invariantName , decryptedConnectionString , appConfigConnectionString , true ) ; }
Helper to update ModelBuilderSettings from GUI
TODO: validate settings on this page are correct
Helper to update ModelBuilderSettings from GUI TODO : validate settings on this page are correct
// don't bother saving anything if there isn't a connection; the user isn't allowed to proceed forward in the wizard anyways // save the initial catalog // these connection strings & invariant names are coming from the ddex provider, so these are "design-time"