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); } }
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); } }); }
private async Task CreateWizardSolutionFileAsync(string destinationFolder, WizardConfiguration wizardConfiguration) { var wizardDataGenrator = new WizardDataGenerator(wizardConfiguration); await wizardDataGenrator.GenerateAndSaveAsync(destinationFolder); }
public SolutionTemplateGenerator(WizardConfiguration wizardConfiguration) { _wizardConfiguration = wizardConfiguration; }
public WizardDataGenerator(WizardConfiguration wizardConfiguration) { _wizardConfiguration = wizardConfiguration; }