public static TransformerSettings CreateDefault() { TransformerSettings transformerSettings = new TransformerSettings { LoggingEnabled = true, InputFilename = @"C:\exampleIn.dsi", AddTransitiveRelationsSettings = new AddTransitiveRelationsSettings(), MoveElementsSettings = new MoveElementsSettings(), MoveHeaderElementsSettings = new MoveHeaderElementsSettings(), SplitProductAndTestElementsSettings = new SplitProductAndTestElementsSettings(), IncludeFilterSettings = new IncludeFilterSettings(), OutputFilename = @"C:\exampleOut.dsi", CompressOutputFile = true }; transformerSettings.MoveElementsSettings.Rules = new List <MoveElementRule> { new MoveElementRule() { From = "Header Files.", To = "Source Files." } }; transformerSettings.SplitProductAndTestElementsSettings.ProductElementIdentifier = "Src"; transformerSettings.SplitProductAndTestElementsSettings.TestElementIdentifier = "Test"; transformerSettings.IncludeFilterSettings.Names = new List <string> { "SomeName" }; return(transformerSettings); }
public static void WriteToFile(string filename, TransformerSettings transformerSettings) { XmlWriterSettings xmlWriterSettings = new XmlWriterSettings() { Indent = true }; XmlSerializer serializer = new XmlSerializer(typeof(TransformerSettings)); using (XmlWriter xmlWriter = XmlWriter.Create(filename, xmlWriterSettings)) { serializer.Serialize(xmlWriter, transformerSettings); } }