Пример #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;
 }