src/Misc/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs
// <summary>
//     After opening a project, we want to see if there is a .config file, parse it, and
//     add the connection strings to our hash.
// </summary>
After opening a project, we want to see if there is a .config file, parse it, and
add the connection strings to our hash.
After opening a project we want to see if there is a . config file parse it and add the connection strings to our hash .
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
        private int OnAfterOpenProject(object sender, ModelChangeEventArgs args)
        {
            if (args.ProjectObj == null)
            {
                Debug.Fail(Resources.ConnectionManager_InitializeError);
                return VSConstants.E_FAIL;
            }
            if (args.ProjectObj.UniqueName.Equals(Constants.vsMiscFilesProjectUniqueName, StringComparison.Ordinal))
            {
                return VSConstants.E_INVALIDARG;
            }
            lock (_hashSyncRoot)
            {
                try
                {
                    ExtractConnStringsIntoHash(args.ProjectObj, false);
                }
                catch (NotImplementedException)
                {
                }
                catch (Exception e)
                {
                    VsUtils.LogOutputWindowPaneMessage(args.ProjectObj, e.Message);
                    return VSConstants.E_FAIL;
                }
            }
            return VSConstants.S_OK;
        }
[ SuppressMessage ( " " , " " ) ] private int OnAfterOpenProject ( object sender , ModelChangeEventArgs args ) { if ( args . ProjectObj == null ) { Debug . Fail ( Resources . ConnectionManager_InitializeError ) ; return VSConstants . E_FAIL ; } if ( args . ProjectObj . UniqueName . Equals ( Constants . vsMiscFilesProjectUniqueName , StringComparison . Ordinal ) ) { return VSConstants . E_INVALIDARG ; } lock ( _hashSyncRoot ) { try { ExtractConnStringsIntoHash ( args . ProjectObj , false ) ; } catch ( NotImplementedException ) { } catch ( Exception e ) { VsUtils . LogOutputWindowPaneMessage ( args . ProjectObj , e . Message ) ; return VSConstants . E_FAIL ; } } return VSConstants . S_OK ; }
After opening a project, we want to see if there is a .config file, parse it, and
add the connection strings to our hash.
After opening a project we want to see if there is a . config file parse it and add the connection strings to our hash .
// if a project doesn't implement any features we try to access along this code path, then ignore it
sender
object
args
ModelChangeEventArgs