예제 #1
1
        public void CreateDefinitions(WizardConfiguration wizardConfiguration)
        {
            var projectCollection = new XElement(Ns + "ProjectCollection");

            var doc = new XDocument(
                new XElement(Ns + "VSTemplate",
                    new XAttribute("Version", "3.0.0"),
                    new XAttribute("Type", "ProjectGroup"),
                    new XElement(Ns + "TemplateData",
                        new XElement(Ns + "Name", wizardConfiguration.Name),
                        new XElement(Ns + "Description", wizardConfiguration.Description),
                        new XElement(Ns + "ProjectType", wizardConfiguration.ProjectType),
                        new XElement(Ns + "DefaultName", wizardConfiguration.DefaultName),
                        new XElement(Ns + "SortOrder", wizardConfiguration.SortOrder),
                        new XElement(Ns + "Icon", wizardConfiguration.IconName)),
                    new XElement(Ns + "TemplateContent", projectCollection),
                    MakeWizardExtension(
                        "LogoFX.Tools.Templates.Wizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
                        $"LogoFX.Tools.Templates.Wizard.SolutionWizard")
                    ));

            XmlWriterSettings settings = new XmlWriterSettings
            {
                OmitXmlDeclaration = true,
                Indent = true
            };

            var definitionFile = GetDefinitionFileName();

            using (XmlWriter xw = XmlWriter.Create(definitionFile, settings))
            {
                doc.Save(xw);
            }
        }
예제 #2
0
 public static Task SaveAsync(string fileName, WizardConfiguration wizardConfiguration)
 {
     return Task.Run(() =>
     {
         XmlSerializer serializer = new XmlSerializer(typeof(WizardConfiguration));
         using (var tw = File.CreateText(fileName))
         {
             serializer.Serialize(tw, wizardConfiguration);
         }
     });
 }
예제 #3
0
 private async Task CreateWizardSolutionFileAsync(string destinationFolder, WizardConfiguration wizardConfiguration)
 {
     var wizardDataGenrator = new WizardDataGenerator(wizardConfiguration);
     await wizardDataGenrator.GenerateAndSaveAsync(destinationFolder);
 }
예제 #4
0
 public SolutionTemplateGenerator(WizardConfiguration wizardConfiguration)
 {
     _wizardConfiguration = wizardConfiguration;
 }
예제 #5
0
 public WizardDataGenerator(WizardConfiguration wizardConfiguration)
 {
     _wizardConfiguration = wizardConfiguration;
 }