Exemplo n.º 1
0
 private static void SetDefaultScaffolderConfigEntry(XmlScaffoldingConfig config, string defaultName, string scaffolderName)
 {
     // Replace any existing entry for this defaultName with the new one
     config.DefaultScaffolders.RemoveAll(x => x.DefaultName.Equals(defaultName, StringComparison.OrdinalIgnoreCase));
     config.DefaultScaffolders.Add(new DefaultScaffolderConfigEntry(defaultName, scaffolderName));
     config.DefaultScaffolders = config.DefaultScaffolders.OrderBy(x => x.DefaultName, StringComparer.OrdinalIgnoreCase).ToList();
 }
 private static void SetDefaultScaffolderConfigEntry(XmlScaffoldingConfig config, string defaultName, string scaffolderName)
 {
     // Replace any existing entry for this defaultName with the new one
     config.DefaultScaffolders.RemoveAll(x => x.DefaultName.Equals(defaultName, StringComparison.OrdinalIgnoreCase));
     config.DefaultScaffolders.Add(new DefaultScaffolderConfigEntry(defaultName, scaffolderName));
     config.DefaultScaffolders = config.DefaultScaffolders.OrderBy(x => x.DefaultName, StringComparer.OrdinalIgnoreCase).ToList();
 }
 private void SaveConfigToFile(string filename, XmlScaffoldingConfig config)
 {
     _solutionManager.EnsureCheckedOutIfExists(filename);
     using (var writer = new XmlTextWriter(filename, Encoding.UTF8) { Formatting = Formatting.Indented }) {
         var serializer = new XmlSerializer(typeof(XmlScaffoldingConfig));
         serializer.Serialize(writer, config);
     }
 }
Exemplo n.º 4
0
 private void SaveConfigToFile(string filename, XmlScaffoldingConfig config)
 {
     _solutionManager.EnsureCheckedOutIfExists(filename);
     using (var writer = new XmlTextWriter(filename, new UTF8Encoding(true))
     {
         Formatting = Formatting.Indented
     }) {
         var serializer = new XmlSerializer(typeof(XmlScaffoldingConfig));
         serializer.Serialize(writer, config);
     }
 }
 private void SaveProjectConfig(Project project, XmlScaffoldingConfig config)
 {
     var projectConfigItem = project.GetProjectItem(ConfigXmlFilename);
     if (projectConfigItem != null) 
         SaveConfigToFile(projectConfigItem.GetFullPath(), config);
     else {
         var outputFilename = Path.Combine(project.GetFullPath(), ConfigXmlFilename);
         SaveConfigToFile(outputFilename, config);
         project.ProjectItems.AddFromFile(outputFilename);
     }
 }
Exemplo n.º 6
0
        private void SaveProjectConfig(Project project, XmlScaffoldingConfig config)
        {
            var projectConfigItem = project.GetProjectItem(ConfigXmlFilename);

            if (projectConfigItem != null)
            {
                SaveConfigToFile(projectConfigItem.GetFullPath(), config);
            }
            else
            {
                var outputFilename = Path.Combine(project.GetFullPath(), ConfigXmlFilename);
                SaveConfigToFile(outputFilename, config);
                project.ProjectItems.AddFromFile(outputFilename);
            }
        }