Browse Source

Cleanup.

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
b1b18b7c59
  1. 3
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs
  2. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs
  3. 3
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
  4. 55
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/BusyManager.cs
  5. 2
      src/Main/Base/Project/Src/Util/ExtensionMethods.cs

3
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs

@ -15,6 +15,7 @@ using ICSharpCode.AvalonEdit.Rendering; @@ -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 @@ -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;

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingManager.cs

@ -8,7 +8,7 @@ using System.Diagnostics; @@ -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
{

3
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj

@ -343,9 +343,6 @@ @@ -343,9 +343,6 @@
</Compile>
<Compile Include="TextViewPosition.cs" />
<Compile Include="Utils\Boxes.cs" />
<Compile Include="Utils\BusyManager.cs">
<DependentUpon>ObserveAddRemoveCollection.cs</DependentUpon>
</Compile>
<Compile Include="Utils\CharRope.cs" />
<Compile Include="Utils\CompressingTreeList.cs" />
<Compile Include="Utils\Constants.cs" />

55
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/BusyManager.cs

@ -1,55 +0,0 @@ @@ -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
{
/// <summary>
/// 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.
/// </summary>
static class BusyManager
{
public struct BusyLock : IDisposable
{
public static readonly BusyLock Failed = new BusyLock(null);
readonly List<object> objectList;
public BusyLock(List<object> 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<object> _activeObjects;
public static BusyLock Enter(object obj)
{
List<object> activeObjects = _activeObjects;
if (activeObjects == null)
activeObjects = _activeObjects = new List<object>();
for (int i = 0; i < activeObjects.Count; i++) {
if (activeObjects[i] == obj)
return BusyLock.Failed;
}
activeObjects.Add(obj);
return new BusyLock(activeObjects);
}
}
}

2
src/Main/Base/Project/Src/Util/ExtensionMethods.cs

@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop @@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop
else
Core.MessageService.ShowException(t.Exception);
}
});
}, TaskContinuationOptions.OnlyOnFaulted);
}
/// <summary>

Loading…
Cancel
Save