This commit is contained in:
kotov.a 2016-09-14 16:35:37 +03:00
parent 4e67459f0c
commit 8a93af528b

View file

@ -17,7 +17,7 @@ namespace Microsoft.DotNet.Tools.Resgen
using (var input = sourceFile.File.OpenRead()) using (var input = sourceFile.File.OpenRead())
{ {
var document = XDocument.Load(input); var document = XDocument.Load(input);
var data = document.Root.Elements("data"); var data = document.Root.Elements("data").ToArray();
if (data.Any()) if (data.Any())
{ {
var rw = new ResourceWriter(outputStream); var rw = new ResourceWriter(outputStream);
@ -25,7 +25,8 @@ namespace Microsoft.DotNet.Tools.Resgen
foreach (var e in data) foreach (var e in data)
{ {
var name = e.Attribute("name").Value; var name = e.Attribute("name").Value;
var value = e.Element("value").Value; var valueElement = e.Element("value");
var value = valueElement != null ? valueElement.Value : e.Value;
rw.AddResource(name, value); rw.AddResource(name, value);
} }