[change] 优化LinkXml生成
parent
768512bcfa
commit
2988aef85a
|
@ -22,18 +22,18 @@ namespace HybridCLR.Editor.Link
|
||||||
writer.WriteStartElement("linker");
|
writer.WriteStartElement("linker");
|
||||||
|
|
||||||
var typesByAssembly = refTypes.GroupBy(t => t.DefinitionAssembly.Name.String).ToList();
|
var typesByAssembly = refTypes.GroupBy(t => t.DefinitionAssembly.Name.String).ToList();
|
||||||
typesByAssembly.Sort((a, b) => a.Key.CompareTo(b.Key));
|
typesByAssembly.Sort((a, b) => String.Compare(a.Key, b.Key, StringComparison.Ordinal));
|
||||||
|
|
||||||
foreach(var assembly in typesByAssembly)
|
foreach(var assembly in typesByAssembly)
|
||||||
{
|
{
|
||||||
writer.WriteStartElement("assembly");
|
writer.WriteStartElement("assembly");
|
||||||
writer.WriteAttributeString("fullname", assembly.Key);
|
writer.WriteAttributeString("fullname", assembly.Key);
|
||||||
List<TypeRef> assTypes = assembly.ToList();
|
List<string> assTypeNames = assembly.Select(t => t.FullName).ToList();
|
||||||
assTypes.Sort((a, b) => a.FullName.CompareTo(b.FullName));
|
assTypeNames.Sort(string.CompareOrdinal);
|
||||||
foreach(var type in assTypes)
|
foreach(var typeName in assTypeNames)
|
||||||
{
|
{
|
||||||
writer.WriteStartElement("type");
|
writer.WriteStartElement("type");
|
||||||
writer.WriteAttributeString("fullname", type.FullName);
|
writer.WriteAttributeString("fullname", typeName);
|
||||||
writer.WriteAttributeString("preserve", "all");
|
writer.WriteAttributeString("preserve", "all");
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue