Skip to content

Commit 844f5b4

Browse files
Merge pull request #3519 from icsharpcode/feature/api-diff
Add CompareView and FrozenContent flag
2 parents c429c6c + 847acf3 commit 844f5b4

25 files changed

+999
-38
lines changed

ICSharpCode.ILSpyX/AssemblyListSnapshot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void AddDescendants(PackageFolder folder)
186186

187187
foreach (var entry in folder.Entries)
188188
{
189-
if (!entry.Name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
189+
if (!entry.Name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) && !entry.Name.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
190190
continue;
191191
var asm = folder.ResolveFileName(entry.Name);
192192
if (asm == null)

ILSpy/AssemblyTree/AssemblyTreeModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,11 @@ public void DecompileSelectedNodes(DecompilerTextViewState? newState = null)
794794
{
795795
var activeTabPage = DockWorkspace.ActiveTabPage;
796796

797+
if (activeTabPage.FrozenContent)
798+
{
799+
activeTabPage = DockWorkspace.AddTabPage();
800+
}
801+
797802
activeTabPage.SupportsLanguageSwitching = true;
798803

799804
if (SelectedItems.Length == 1)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright (c) 2025 AlphaSierraPapa for the SharpDevelop Team
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
4+
// software and associated documentation files (the "Software"), to deal in the Software
5+
// without restriction, including without limitation the rights to use, copy, modify, merge,
6+
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7+
// to whom the Software is furnished to do so, subject to the following conditions:
8+
//
9+
// The above copyright notice and this permission notice shall be included in all copies or
10+
// substantial portions of the Software.
11+
//
12+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14+
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
15+
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
// DEALINGS IN THE SOFTWARE.
18+
19+
using System.Composition;
20+
using System.Threading.Tasks;
21+
22+
using ICSharpCode.ILSpy.AssemblyTree;
23+
using ICSharpCode.ILSpy.Docking;
24+
using ICSharpCode.ILSpy.TreeNodes;
25+
using ICSharpCode.ILSpy.ViewModels;
26+
using ICSharpCode.ILSpy.Views;
27+
28+
namespace ICSharpCode.ILSpy
29+
{
30+
[ExportContextMenuEntry(Header = "Compare...", Order = 9999)]
31+
[Shared]
32+
internal sealed class CompareContextMenuEntry(AssemblyTreeModel assemblyTreeModel, DockWorkspace dockWorkspace) : IContextMenuEntry
33+
{
34+
public void Execute(TextViewContext context)
35+
{
36+
var left = ((AssemblyTreeNode)context.SelectedTreeNodes[0]).LoadedAssembly;
37+
var right = ((AssemblyTreeNode)context.SelectedTreeNodes[1]).LoadedAssembly;
38+
39+
var tabPage = dockWorkspace.AddTabPage();
40+
CompareViewModel.Show(tabPage, left, right, assemblyTreeModel);
41+
}
42+
43+
public bool IsEnabled(TextViewContext context)
44+
{
45+
return true;
46+
}
47+
48+
public bool IsVisible(TextViewContext context)
49+
{
50+
return context.SelectedTreeNodes is [AssemblyTreeNode { LoadedAssembly.IsLoadedAsValidAssembly: true }, AssemblyTreeNode { LoadedAssembly.IsLoadedAsValidAssembly: true }];
51+
}
52+
}
53+
}

ILSpy/Commands/SearchMsdnContextMenuEntry.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
// DEALINGS IN THE SOFTWARE.
1818

1919
using System.Linq;
20-
using System.Threading;
2120

2221
using ICSharpCode.ILSpy.Properties;
2322
using ICSharpCode.ILSpy.TreeNodes;

ILSpy/Controls/TreeView/SharpTreeView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
VerticalAlignment="Center" />
247247
</Border>
248248
<StackPanel Orientation="Horizontal"
249-
Background="Transparent"
249+
Background="{Binding Background}"
250250
ToolTip="{Binding ToolTip}">
251251
<ContentPresenter Name="icon"
252252
Content="{Binding Icon}"

ILSpy/Docking/DockWorkspace.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ private void TabPages_CollectionChanged(object sender, NotifyCollectionChangedEv
118118
}
119119
}
120120

121-
public void AddTabPage(TabPageModel tabPage = null)
121+
public TabPageModel AddTabPage(TabPageModel tabPage = null)
122122
{
123-
tabPages.Add(tabPage ?? exportProvider.GetExportedValue<TabPageModel>());
123+
TabPageModel item = tabPage ?? exportProvider.GetExportedValue<TabPageModel>();
124+
tabPages.Add(item);
125+
return item;
124126
}
125127

126128
public ReadOnlyObservableCollection<TabPageModel> TabPages { get; }

ILSpy/Images/DictionaryContain.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- This file was generated by the AiToXaml tool.-->
2+
<!-- Tool Version: 14.0.22307.0 -->
3+
<DrawingGroup xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ClipGeometry="M0,0 V16 H16 V0 H0 Z">
4+
<DrawingGroup.Children>
5+
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
6+
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M15,2L15,11 11,11C10.836,11.005,10,12,10,12L8,12C8,12,7.164,11.005,7,11L7,13 2,13 2,8 3,8 3,2 7.5,2C8.146,2.004 8.62,2.191 9,2.5 9.381,2.191 9.863,2 10.5,2z" />
7+
<GeometryDrawing Brush="#FF424242" Geometry="F1M13,9L11,9C10.565,9,10.33,8.795,10,9L10,5C10,4.615,10.41,4,11,4L13,4z M10.5,3C9.876,3 9.516,3.365 9,4 8.492,3.374 8.139,3.004 7.5,3L4,3 4,8 5,8 5,4 7,4C7.566,4,8,4.663,8,5L8,9C7.67,8.795,7.436,9,7,9L7,10C7.549,10 8.778,9.975 9,10.5 9.221,9.975 10.451,10 11,10L14,10 14,3z" />
8+
<GeometryDrawing Brush="#FF424242" Geometry="F1M3,11L6,11 6,12 3,12z" />
9+
<GeometryDrawing Brush="#FF424242" Geometry="F1M3,10L6,10 6,9 3,9z" />
10+
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M7,4L5,4 5,8 7,8 7,9C7.436,9,7.67,8.795,8,9L8,5C8,4.663,7.566,4,7,4" />
11+
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M11,4C10.41,4,10,4.615,10,5L10,9C10.33,8.795,10.565,9,11,9L13,9 13,4z" />
12+
</DrawingGroup.Children>
13+
</DrawingGroup>

ILSpy/Images/ExpandAll.svg

Lines changed: 1 addition & 0 deletions
Loading

ILSpy/Images/ExpandAll.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- This file was generated by the AiToXaml tool.-->
2+
<!-- Tool Version: 14.0.22307.0 -->
3+
<DrawingGroup xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
4+
<DrawingGroup.Children>
5+
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
6+
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M15,10L13,10 13,12 11,12 11,14 2,14 2,5 4,5 4,3 6,3 6,1 15,1z" />
7+
<GeometryDrawing Brush="#FF424242" Geometry="F1M9,7L4,7 4,12 9,12z M10,13L3,13 3,6 10,6z M5,4L5,5 6,5 11,5 11,10 11,11 12,11 12,4z M14,2L14,9 13,9 13,8 13,3 8,3 7,3 7,2z" />
8+
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M8,10L7,10 7,11 6.984,11 6,11 6,10 5,10 5,9 6,9 6,8 7,8 7,9 8,9z M4,12L9,12 9,7 4,7z" />
9+
<GeometryDrawing Brush="#FF00539C" Geometry="F1M7,9L8,9 8,10 6.995,10 6.984,11 6,11 6,10 5,10 5,9 6,9 6,8 7,8z" />
10+
</DrawingGroup.Children>
11+
</DrawingGroup>

0 commit comments

Comments
 (0)