|
28 | 28 | using ICSharpCode.Decompiler; |
29 | 29 | using ICSharpCode.Decompiler.Solution; |
30 | 30 | using ICSharpCode.Decompiler.Util; |
31 | | -using ICSharpCode.ILSpy.Docking; |
32 | 31 | using ICSharpCode.ILSpy.TextView; |
33 | 32 | using ICSharpCode.ILSpy.ViewModels; |
34 | 33 | using ICSharpCode.ILSpyX; |
@@ -99,13 +98,42 @@ async Task<AvalonEditTextOutput> CreateSolution(TabPageModel tabPage, IEnumerabl |
99 | 98 | { |
100 | 99 | var result = new AvalonEditTextOutput(); |
101 | 100 |
|
102 | | - var duplicates = new HashSet<string>(); |
103 | | - if (assemblies.Any(asm => !duplicates.Add(asm.ShortName))) |
| 101 | + var assembliesByShortName = assemblies.ToLookup(_ => _.ShortName); |
| 102 | + bool first = true; |
| 103 | + bool abort = false; |
| 104 | + |
| 105 | + foreach (var item in assembliesByShortName) |
104 | 106 | { |
105 | | - result.WriteLine("Duplicate assembly names selected, cannot generate a solution."); |
106 | | - return result; |
| 107 | + var enumerator = item.GetEnumerator(); |
| 108 | + if (!enumerator.MoveNext()) |
| 109 | + continue; |
| 110 | + var firstAssembly = enumerator.Current; |
| 111 | + if (!enumerator.MoveNext()) |
| 112 | + continue; |
| 113 | + if (first) |
| 114 | + { |
| 115 | + result.WriteLine("Duplicate assembly names selected, cannot generate a solution:"); |
| 116 | + abort = true; |
| 117 | + } |
| 118 | + |
| 119 | + result.Write("- " + firstAssembly.Text + " conflicts with "); |
| 120 | + |
| 121 | + first = true; |
| 122 | + do |
| 123 | + { |
| 124 | + var asm = enumerator.Current; |
| 125 | + if (!first) |
| 126 | + result.Write(", "); |
| 127 | + result.Write(asm.Text); |
| 128 | + first = false; |
| 129 | + } while (enumerator.MoveNext()); |
| 130 | + result.WriteLine(); |
| 131 | + first = false; |
107 | 132 | } |
108 | 133 |
|
| 134 | + if (abort) |
| 135 | + return result; |
| 136 | + |
109 | 137 | Stopwatch stopwatch = Stopwatch.StartNew(); |
110 | 138 |
|
111 | 139 | try |
|
0 commit comments