diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs index 80902ea5df..b47bc3b841 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs @@ -15,6 +15,7 @@ using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Widgets.MyersDiff; +using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.AvalonEdit.AddIn { @@ -229,7 +230,7 @@ namespace ICSharpCode.AvalonEdit.AddIn differ.editor.Visibility = Visibility.Collapsed; differ.copyButton.Visibility = Visibility.Collapsed; } else { - var baseDocument = new TextDocument(changeWatcher.BaseDocument); + var baseDocument = new ReadOnlyDocument(changeWatcher.BaseDocument); if (differ.editor.SyntaxHighlighting != null) { var mainHighlighter = new DocumentHighlighter(baseDocument, differ.editor.SyntaxHighlighting.MainRuleSet); var popupHighlighter = differ.editor.TextArea.GetService(typeof(IHighlighter)) as DocumentHighlighter; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs index ee1d5167c0..b6598c12c4 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs @@ -8,7 +8,7 @@ using System.Diagnostics; using System.IO; using System.Xml; -using ICSharpCode.AvalonEdit.Utils; +using ICSharpCode.NRefactory.Utils; namespace ICSharpCode.AvalonEdit.Highlighting { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj index 9abcd2b944..d4d293044b 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj @@ -343,9 +343,6 @@ - - ObserveAddRemoveCollection.cs - diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/BusyManager.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/BusyManager.cs deleted file mode 100644 index f5c4047b71..0000000000 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/BusyManager.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - -using System; -using System.Collections.Generic; - -namespace ICSharpCode.AvalonEdit.Utils -{ - /// - /// This class is used to prevent stack overflows by representing a 'busy' flag - /// that prevents reentrance when another call is running. - /// However, using a simple 'bool busy' is not thread-safe, so we use a - /// thread-static BusyManager. - /// - static class BusyManager - { - public struct BusyLock : IDisposable - { - public static readonly BusyLock Failed = new BusyLock(null); - - readonly List objectList; - - public BusyLock(List objectList) - { - this.objectList = objectList; - } - - public bool Success { - get { return objectList != null; } - } - - public void Dispose() - { - if (objectList != null) { - objectList.RemoveAt(objectList.Count - 1); - } - } - } - - [ThreadStatic] static List _activeObjects; - - public static BusyLock Enter(object obj) - { - List activeObjects = _activeObjects; - if (activeObjects == null) - activeObjects = _activeObjects = new List(); - for (int i = 0; i < activeObjects.Count; i++) { - if (activeObjects[i] == obj) - return BusyLock.Failed; - } - activeObjects.Add(obj); - return new BusyLock(activeObjects); - } - } -} diff --git a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs index c6b690dd83..0df56d8452 100644 --- a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs +++ b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs @@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop else Core.MessageService.ShowException(t.Exception); } - }); + }, TaskContinuationOptions.OnlyOnFaulted); } ///