src/Misc/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs
// <summary>
//     Takes our local hash and destructively updates the .config file.
// </summary>
// <param name="project">DTE Project that owns the .config file we want to look at.</param>
Takes our local hash and destructively updates the .config file.
Takes our local hash and destructively updates the . config file .
private void InsertConnStringsFromHash(Project project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }
            if (project.UniqueName.Equals(Constants.vsMiscFilesProjectUniqueName, StringComparison.Ordinal))
            {
                return;
            }
            InitializeConnectionStringsHash();
            var configFileUtils = new ConfigFileUtils(project, PackageManager.Package);
            configFileUtils.GetOrCreateConfigFile();
            var configXmlDoc = configFileUtils.LoadConfig();
            Dictionary<string, ConnectionString> hash;
            if (!ConnStringsByProjectHash.TryGetValue(project, out hash))
            {
                var s = String.Format(CultureInfo.CurrentCulture, Resources.ConnectionManager_GetConfigError);
                VsUtils.LogOutputWindowPaneMessage(project, s);
                return;
            }
            if (hash.Any())
            {
                UpdateEntityConnectionStringsInConfig(configXmlDoc, hash);
                configFileUtils.SaveConfig(configXmlDoc);
            }
        }
private void InsertConnStringsFromHash ( Project project ) { if ( project == null ) { throw new ArgumentNullException ( " " ) ; } if ( project . UniqueName . Equals ( Constants . vsMiscFilesProjectUniqueName , StringComparison . Ordinal ) ) { return ; } InitializeConnectionStringsHash ( ) ; var configFileUtils = new ConfigFileUtils ( project , PackageManager . Package ) ; configFileUtils . GetOrCreateConfigFile ( ) ; var configXmlDoc = configFileUtils . LoadConfig ( ) ; Dictionary < string , ConnectionString > hash ; if ( ! ConnStringsByProjectHash . TryGetValue ( project , out hash ) ) { var s = String . Format ( CultureInfo . CurrentCulture , Resources . ConnectionManager_GetConfigError ) ; VsUtils . LogOutputWindowPaneMessage ( project , s ) ; return ; } if ( hash . Any ( ) ) { UpdateEntityConnectionStringsInConfig ( configXmlDoc , hash ) ; configFileUtils . SaveConfig ( configXmlDoc ) ; } }
Takes our local hash and destructively updates the .config file.
Takes our local hash and destructively updates the . config file .
project
Project
DTE Project that owns the .config file we want to look at.
DTE Project that owns the . config file we want to look at .