Exemple #1
0
 public void Translate(Resource resource, string outputDirectory)
 {
     using (var reader = XmlReader.Create((Stream)resource.Value))
     {
         string jsonFilename = Path.ChangeExtension(resource.Name, ".json");
         string jsonFilepath = Path.Combine(outputDirectory, jsonFilename);
         var converter = new XamlToJsonConverter(reader);
         converter.WriteTo(jsonFilepath);
     }
 }
 private void TranslateFromStream(FileStream stream, string outputDirectory)
 {
     var resourceReader = new ResourceReader(stream);
     var enumerator = resourceReader.GetEnumerator();
     while (enumerator.MoveNext())
     {
         var resource = new Resource(enumerator.Key, enumerator.Value);
         xamlTranslator.Translate(resource, outputDirectory);
     }
 }