static ProjectWrapper ProjectWrapperSelector(ProjectItem item1) { return new ProjectWrapper { Name = GetName(item1), OutputPath = item1.ContainingProject.ConfigurationManager.ActiveConfiguration.FindProperty(ConfigurationProperty.OutputPath).Value.ToString(), OutPutFileName = item1.ContainingProject.FindProperty(ProjectProperty.OutputFileName).Value.ToString(), FullPath = item1.ContainingProject.FindProperty(ProjectProperty.FullPath).Value.ToString(), UniqueName = item1.ContainingProject.UniqueName, LocalPath = item1.FindProperty(ProjectItemProperty.LocalPath).Value.ToString() }; }
private static ConnectionStringSettings GetConnectionStringSettings(ProjectItem item, string name) { Property property = item.FindProperty(ProjectItemProperty.FullPath); var exeConfigurationFileMap = new ExeConfigurationFileMap { ExeConfigFilename = property.Value.ToString() }; var configuration = System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(exeConfigurationFileMap, ConfigurationUserLevel.None); ConnectionStringsSection strings = configuration.ConnectionStrings; return(strings.ConnectionStrings[name]); }
static ProjectWrapper ProjectWrapperSelector(ProjectItem item1) { return(new ProjectWrapper { Name = GetName(item1), OutputPath = item1.ContainingProject.ConfigurationManager.ActiveConfiguration.FindProperty(ConfigurationProperty.OutputPath).Value.ToString(), OutPutFileName = item1.ContainingProject.FindProperty(ProjectProperty.OutputFileName).Value.ToString(), FullPath = item1.ContainingProject.FindProperty(ProjectProperty.FullPath).Value.ToString(), UniqueName = item1.ContainingProject.UniqueName, LocalPath = item1.FindProperty(ProjectItemProperty.LocalPath).Value.ToString() }); }
private ConnectionStringSettings GetConnectionStringSettings(ProjectItem item, string name) { Property property = item.FindProperty(ProjectItemProperty.FullPath); var exeConfigurationFileMap = new ExeConfigurationFileMap { ExeConfigFilename = property.Value.ToString() }; Configuration configuration = ConfigurationManager.OpenMappedExeConfiguration(exeConfigurationFileMap, ConfigurationUserLevel.None); ConnectionStringsSection strings = configuration.ConnectionStrings; return strings.ConnectionStrings[name]; }