예제 #1
0
 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()
     };
 }
예제 #2
0
        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]);
        }
예제 #3
0
 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()
     });
 }
예제 #4
0
 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];
 }