.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Siegfried Pammer 9e08b348b3 Fix build of TestPlugin/ContextMenuCommand 7 years ago
..
Properties Convert projects to the new project system 8 years ago
AboutPageAddition.cs Added an About page addition to the test plugin. 7 years ago
Clear.png Add TestPlugin. 14 years ago
ContextMenuCommand.cs Fix build of TestPlugin/ContextMenuCommand 7 years ago
CustomLanguage.cs Fix build of TestPlugin 7 years ago
CustomOptionPage.xaml Add context menu command and option page to the test plugin. 14 years ago
CustomOptionPage.xaml.cs Remove unused usings in solution; remove dead code; unify namespaces 9 years ago
MainMenuCommand.cs Remove unused usings in solution; remove dead code; unify namespaces 9 years ago
Readme.txt Add context menu command and option page to the test plugin. 14 years ago
TestPlugin.csproj Added an About page addition to the test plugin. 7 years ago

Readme.txt

ILSpy uses MEF (Managed Extensibility Framework) for plugins.
Plugins must be placed in the same directory as ILSpy.exe, and must be called "*.Plugin.dll".

To write a plugin, you need to add a reference to ILSpy.exe and to System.ComponentModel.Composition.
Depending on what your plugin is doing, you might also need references to the other libraries shipping with ILSpy.

Plugins work by exporting types for certain extension points.
Here is a list of extension points:

Adding another language:

[Export(typeof(Language))]
public class CustomLanguage : Language

This adds an additional language to the combobox in the toolbar.
The language has to implement its own decompiler (all the way from IL), but it can also re-use
the ICSharpCode.Decompiler library to decompile to C#, and then translate the C# code to the target language.

---

Adding an entry to the main menu:

[ExportMainMenuCommand(Menu = "_File", MenuIcon = "Clear.png", Header = "_Clear List", MenuCategory = "Open", MenuOrder = 1.5)]
public class UnloadAllAssembliesCommand : SimpleCommand

Menu: menu into which the item is added
MenuIcon: optional, icon to use for the menu item. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
Header: text on the menu item
MenuCategory: optional, used for grouping related menu items together. A separator is added between different groups.
MenuOrder: controls the order in which the items appear (items are sorted by this value)

The command class must implement WPF's ICommand interface.

---

Adding an entry to the tool bar:

[ExportToolbarCommand(ToolTip = "Clears the current assembly list", ToolbarIcon = "Clear.png", ToolbarCategory = "Open", ToolbarOrder = 1.5)]
public class UnloadAllAssembliesCommand : SimpleCommand

ToolTip: the tool tip
ToolbarIcon: The icon. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
ToolbarCategory: optional, used for grouping related toolbar items together. A separator is added between different groups.
ToolbarOrder: controls the order in which the items appear (items are sorted by this value)

The command class must implement WPF's ICommand interface.

---

Adding an entry to the context menu:

[ExportContextMenuEntry(Header = "_Save Assembly")]
public class SaveAssembly : IContextMenuEntry

Icon: optional, icon to use for the menu item. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
Header: text on the menu item
Category: optional, used for grouping related menu items together. A separator is added between different groups.
Order: controls the order in which the items appear (items are sorted by this value)

Context menu entries must implement IContextMenuEntry, which defines 3 methods:
bool IsVisible, bool IsEnabled, and void Execute.

---

Adding an option page:

[ExportOptionPage("TestPlugin")]
partial class CustomOptionPage : UserControl, IOptionPage