diff --git a/Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs b/Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs
index f87bf6c51..915bd7e0d 100644
--- a/Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs
+++ b/Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
@@ -17,6 +18,7 @@ using Mono.Cecil;
namespace ILSpy.Debugger.AvalonEdit
{
+ [Export("IconMargin"), PartCreationPolicy(CreationPolicy.Shared)]
public class IconBarMargin : AbstractMargin, IDisposable
{
public IconBarMargin()
diff --git a/Debugger/ILSpy.Debugger/AvalonEdit/TextMarkerService.cs b/Debugger/ILSpy.Debugger/AvalonEdit/TextMarkerService.cs
index 7df2da927..2e7191f32 100644
--- a/Debugger/ILSpy.Debugger/AvalonEdit/TextMarkerService.cs
+++ b/Debugger/ILSpy.Debugger/AvalonEdit/TextMarkerService.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.Composition;
using System.Linq;
using System.Windows;
using System.Windows.Media;
@@ -18,20 +19,23 @@ namespace ILSpy.Debugger.AvalonEdit
///
/// Handles the text markers for a code editor.
///
+ [Export("TextMarkerService"), PartCreationPolicy(CreationPolicy.Shared)]
public sealed class TextMarkerService : DocumentColorizingTransformer, IBackgroundRenderer, ITextMarkerService
{
- readonly TextEditor codeEditor;
+ TextEditor codeEditor;
+
TextSegmentCollection markers = new TextSegmentCollection();
- public TextMarkerService(TextEditor codeEditor)
- {
- if (codeEditor == null)
- throw new ArgumentNullException("codeEditor");
- this.codeEditor = codeEditor;
-
+ public TextMarkerService()
+ {
BookmarkManager.Added += new BookmarkEventHandler(BookmarkManager_Added);
BookmarkManager.Removed += new BookmarkEventHandler(BookmarkManager_Removed);
}
+
+ public TextEditor CodeEditor {
+ get { return codeEditor; }
+ set { codeEditor = value; }
+ }
void BookmarkManager_Removed(object sender, BookmarkEventArgs e)
{
diff --git a/Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj b/Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj
index 9888ae8d5..dcc668a3a 100644
--- a/Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj
+++ b/Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj
@@ -38,6 +38,9 @@
3.0
+
+ 4.0
+
3.5
diff --git a/ILSpy/App.xaml.cs b/ILSpy/App.xaml.cs
index 9f9cac6eb..168cfb4c1 100644
--- a/ILSpy/App.xaml.cs
+++ b/ILSpy/App.xaml.cs
@@ -46,6 +46,7 @@ namespace ICSharpCode.ILSpy
var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new AssemblyCatalog(typeof(App).Assembly));
catalog.Catalogs.Add(new DirectoryCatalog(".", "*.Plugin.dll"));
+ catalog.Catalogs.Add(new DirectoryCatalog(".", "*.Debugger.dll"));
compositionContainer = new CompositionContainer(catalog);
diff --git a/ILSpy/Commands/DebuggerCommands.cs b/ILSpy/Commands/DebuggerCommands.cs
index c2e082630..f1853bba8 100644
--- a/ILSpy/Commands/DebuggerCommands.cs
+++ b/ILSpy/Commands/DebuggerCommands.cs
@@ -104,6 +104,9 @@ namespace ICSharpCode.ILSpy.Commands
var items = menuItems.OfType