Browse Source

Fix #1599: Ignore duplicate keys in resource dictionary.

pull/1633/head
Siegfried Pammer 6 years ago
parent
commit
c9d2e4f728
  1. 2
      ILSpy.BamlDecompiler/Rewrite/MarkupExtensionRewritePass.cs

2
ILSpy.BamlDecompiler/Rewrite/MarkupExtensionRewritePass.cs

@ -77,6 +77,7 @@ namespace ILSpy.BamlDecompiler.Rewrite { @@ -77,6 +77,7 @@ namespace ILSpy.BamlDecompiler.Rewrite {
var attrName = elem.Name;
if (attrName != key)
attrName = property.ToXName(ctx, parent, property.IsAttachedTo(type));
if (!parent.Attributes(attrName).Any()) {
var attr = new XAttribute(attrName, extValue);
var list = new List<XAttribute>(parent.Attributes());
if (attrName == key)
@ -85,6 +86,7 @@ namespace ILSpy.BamlDecompiler.Rewrite { @@ -85,6 +86,7 @@ namespace ILSpy.BamlDecompiler.Rewrite {
list.Add(attr);
parent.RemoveAttributes();
parent.ReplaceAttributes(list);
}
elem.Remove();
return true;

Loading…
Cancel
Save