예제 #1
0
		private static bool SaveWSOFile(string filePath, MainViewModel viewmodel)
		{
			// Get UIOptionRootType from View Model
			UIOptionRootType rootOptions = OptionMapper.DefaultXmlToOptionModel();
			OptionMapper.UIModelToOptionModel(rootOptions, viewmodel, false);

			IVisitorWithContext visitor = new XmlWriteVisitor();
			rootOptions.Accept(visitor, filePath);
			return true;
		}
예제 #2
0
		public void TestXmlWriter()
		{
			UIOptionRootType optionsRoot = TestHelper.ReadTestXML();

			IVisitorWithContext writeVisitor = new XmlWriteVisitor();
			optionsRoot.Accept(writeVisitor, _xmlOutputPath);

			Assert.IsTrue(File.Exists(_xmlOutputPath));

			FileInfo original = new FileInfo(_xmlOriginalPath);
			FileInfo generated = new FileInfo(_xmlOutputPath);

			Assert.AreEqual(original.Length, generated.Length);
		}