Browse Source

Move MultiHighlighter to AvalonEdit.AddIn

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
643223761d
  1. 14
      samples/PortSD4AddInToSD5/WorkbenchSingletonIssueProvider.cs
  2. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj
  3. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs
  4. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
  5. 4
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DiffControl.xaml.cs
  6. 119
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/MultiHighlighter.cs
  7. 1
      src/AddIns/VersionControl/SubversionAddIn/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs
  8. 1
      src/AddIns/VersionControl/SubversionAddIn/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs
  9. 3
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedLine.cs
  10. 7
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColor.cs
  11. 109
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/IHighlighter.cs
  12. 2
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
  13. 19
      src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs

14
samples/PortSD4AddInToSD5/WorkbenchSingletonIssueProvider.cs

@ -53,6 +53,20 @@ namespace PortSD4AddInToSD5
script.Replace(mre, new IdentifierExpression("SD").Member("StatusBar")); script.Replace(mre, new IdentifierExpression("SD").Member("StatusBar"));
}); });
break; break;
case "ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.InvokeRequired":
yield return Issue(
mre,
script => {
script.Replace(mre, new IdentifierExpression("SD").Member("MainThread").Member("InvokeRequired"));
});
break;
case "ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow":
yield return Issue(
mre,
script => {
script.Replace(mre, new IdentifierExpression("SD").Member("Workbench").Member("MainWindow"));
});
break;
} }
} }
foreach (var invocationExpression in context.RootNode.Descendants.OfType<InvocationExpression>()) { foreach (var invocationExpression in context.RootNode.Descendants.OfType<InvocationExpression>()) {

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj

@ -105,6 +105,7 @@
<Compile Include="Src\ContextActions\GoToEntityAction.cs" /> <Compile Include="Src\ContextActions\GoToEntityAction.cs" />
<Compile Include="Src\DocumentSequence.cs" /> <Compile Include="Src\DocumentSequence.cs" />
<Compile Include="Src\EnhancedScrollBar.cs" /> <Compile Include="Src\EnhancedScrollBar.cs" />
<Compile Include="Src\MultiHighlighter.cs" />
<Compile Include="Src\Snippets\CodeSnippetComparer.cs" /> <Compile Include="Src\Snippets\CodeSnippetComparer.cs" />
<Compile Include="Src\Utils.cs" /> <Compile Include="Src\Utils.cs" />
<Compile Include="Src\XmlDoc\DocumentationUIBuilder.cs" /> <Compile Include="Src\XmlDoc\DocumentationUIBuilder.cs" />

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs

@ -17,7 +17,6 @@ using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor.Bookmarks; using ICSharpCode.SharpDevelop.Editor.Bookmarks;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.Bookmarks;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Parser;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs

@ -27,7 +27,6 @@ using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor.Bookmarks; using ICSharpCode.SharpDevelop.Editor.Bookmarks;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.Bookmarks;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion; using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Parser;
using ICSharpCode.SharpDevelop.Widgets.MyersDiff; using ICSharpCode.SharpDevelop.Widgets.MyersDiff;

4
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DiffControl.xaml.cs

@ -28,8 +28,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
{ {
InitializeComponent(); InitializeComponent();
revertButton.Content = PresentationResourceService.GetImage("Icons.16x16.UndoIcon"); revertButton.Content = SD.ResourceService.GetImage("Icons.16x16.UndoIcon").CreateImage();
copyButton.Content = PresentationResourceService.GetImage("Icons.16x16.CopyIcon"); copyButton.Content = SD.ResourceService.GetImage("Icons.16x16.CopyIcon").CreateImage();
} }
void CopyButtonClick(object sender, RoutedEventArgs e) void CopyButtonClick(object sender, RoutedEventArgs e)

119
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/MultiHighlighter.cs

@ -0,0 +1,119 @@
// 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;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.NRefactory.Editor;
namespace ICSharpCode.AvalonEdit.AddIn
{
public class MultiHighlighter : IHighlighter
{
readonly IHighlighter[] nestedHighlighters;
readonly IDocument document;
public MultiHighlighter(IDocument document, params IHighlighter[] nestedHighlighters)
{
if (document == null)
throw new ArgumentNullException("document");
if (nestedHighlighters == null)
throw new ArgumentNullException("additionalHighlighters");
foreach (var highlighter in nestedHighlighters) {
if (highlighter == null)
throw new ArgumentException("nulls not allowed!");
if (document != highlighter.Document)
throw new ArgumentException("all highlighters must be assigned to the same document!");
}
this.nestedHighlighters = nestedHighlighters;
this.document = document;
}
public event HighlightingStateChangedEventHandler HighlightingStateChanged {
add {
foreach (var highlighter in nestedHighlighters) {
highlighter.HighlightingStateChanged += value;
}
}
remove {
foreach (var highlighter in nestedHighlighters) {
highlighter.HighlightingStateChanged -= value;
}
}
}
public IDocument Document {
get {
return document;
}
}
public HighlightingColor DefaultTextColor {
get {
if (nestedHighlighters.Length > 0)
return nestedHighlighters[0].DefaultTextColor;
return null;
}
}
public IEnumerable<HighlightingColor> GetColorStack(int lineNumber)
{
List<HighlightingColor> list = new List<HighlightingColor>();
for (int i = nestedHighlighters.Length - 1; i >= 0; i--) {
var s = nestedHighlighters[i].GetColorStack(lineNumber);
if (s != null)
list.AddRange(s);
}
return list;
}
public HighlightedLine HighlightLine(int lineNumber)
{
HighlightedLine line = new HighlightedLine(document, document.GetLineByNumber(lineNumber));
foreach (IHighlighter h in nestedHighlighters) {
line.MergeWith(h.HighlightLine(lineNumber));
}
return line;
}
public void UpdateHighlightingState(int lineNumber)
{
foreach (var h in nestedHighlighters) {
h.UpdateHighlightingState(lineNumber);
}
}
public void BeginHighlighting()
{
foreach (var h in nestedHighlighters) {
h.BeginHighlighting();
}
}
public void EndHighlighting()
{
foreach (var h in nestedHighlighters) {
h.EndHighlighting();
}
}
public HighlightingColor GetNamedColor(string name)
{
foreach (var h in nestedHighlighters) {
var color = h.GetNamedColor(name);
if (color != null)
return color;
}
return null;
}
public void Dispose()
{
foreach (var h in nestedHighlighters) {
h.Dispose();
}
}
}
}

1
src/AddIns/VersionControl/SubversionAddIn/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs

@ -7,6 +7,7 @@ using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Svn namespace ICSharpCode.Svn

1
src/AddIns/VersionControl/SubversionAddIn/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs

@ -9,6 +9,7 @@ using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.Core.WinForms; using ICSharpCode.Core.WinForms;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Svn namespace ICSharpCode.Svn

3
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightedLine.cs

@ -259,6 +259,9 @@ namespace ICSharpCode.AvalonEdit.Highlighting
} }
#endregion #endregion
/// <summary>
/// Creates a <see cref="HighlightedInlineBuilder"/> that stores the text and highlighting of this line.
/// </summary>
public HighlightedInlineBuilder ToInlineBuilder() public HighlightedInlineBuilder ToInlineBuilder()
{ {
HighlightedInlineBuilder builder = new HighlightedInlineBuilder(Document.GetText(DocumentLine)); HighlightedInlineBuilder builder = new HighlightedInlineBuilder(Document.GetText(DocumentLine));

7
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/HighlightingColor.cs

@ -17,13 +17,6 @@ namespace ICSharpCode.AvalonEdit.Highlighting
[Serializable] [Serializable]
public class HighlightingColor : ISerializable public class HighlightingColor : ISerializable
{ {
[NonSerialized]
public static readonly HighlightingColor DefaultColor = new HighlightingColor {
Background = new SimpleHighlightingBrush(Brushes.White),
Foreground = new SimpleHighlightingBrush(Brushes.Black),
Name = "<default>"
};
/// <summary> /// <summary>
/// Gets/Sets the name of the color. /// Gets/Sets the name of the color.
/// </summary> /// </summary>

109
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/IHighlighter.cs

@ -91,115 +91,6 @@ namespace ICSharpCode.AvalonEdit.Highlighting
HighlightingColor DefaultTextColor { get; } HighlightingColor DefaultTextColor { get; }
} }
public class MultiHighlighter : IHighlighter
{
readonly IHighlighter[] nestedHighlighters;
readonly IDocument document;
public MultiHighlighter(IDocument document, params IHighlighter[] nestedHighlighters)
{
if (document == null)
throw new ArgumentNullException("document");
if (nestedHighlighters == null)
throw new ArgumentNullException("additionalHighlighters");
foreach (var highlighter in nestedHighlighters) {
if (highlighter == null)
throw new ArgumentException("nulls not allowed!");
if (document != highlighter.Document)
throw new ArgumentException("all highlighters must be assigned to the same document!");
}
this.nestedHighlighters = nestedHighlighters;
this.document = document;
}
public event HighlightingStateChangedEventHandler HighlightingStateChanged {
add {
foreach (var highlighter in nestedHighlighters) {
highlighter.HighlightingStateChanged += value;
}
}
remove {
foreach (var highlighter in nestedHighlighters) {
highlighter.HighlightingStateChanged -= value;
}
}
}
public IDocument Document {
get {
return document;
}
}
public HighlightingColor DefaultTextColor {
get {
if (nestedHighlighters.Length > 0)
return nestedHighlighters[0].DefaultTextColor;
return HighlightingColor.DefaultColor;
}
}
public IEnumerable<HighlightingColor> GetColorStack(int lineNumber)
{
List<HighlightingColor> list = new List<HighlightingColor>();
for (int i = nestedHighlighters.Length - 1; i >= 0; i--) {
var s = nestedHighlighters[i].GetColorStack(lineNumber);
if (s != null)
list.AddRange(s);
}
return list;
}
public HighlightedLine HighlightLine(int lineNumber)
{
HighlightedLine line = new HighlightedLine(document, document.GetLineByNumber(lineNumber));
foreach (IHighlighter h in nestedHighlighters) {
line.MergeWith(h.HighlightLine(lineNumber));
}
return line;
}
public void UpdateHighlightingState(int lineNumber)
{
foreach (var h in nestedHighlighters) {
h.UpdateHighlightingState(lineNumber);
}
}
public void BeginHighlighting()
{
foreach (var h in nestedHighlighters) {
h.BeginHighlighting();
}
}
public void EndHighlighting()
{
foreach (var h in nestedHighlighters) {
h.EndHighlighting();
}
}
public HighlightingColor GetNamedColor(string name)
{
foreach (var h in nestedHighlighters) {
var color = h.GetNamedColor(name);
if (color != null)
return color;
}
return null;
}
public void Dispose()
{
foreach (var h in nestedHighlighters) {
h.Dispose();
}
}
}
/// <summary> /// <summary>
/// Event handler for <see cref="IHighlighter.HighlightingStateChanged"/> /// Event handler for <see cref="IHighlighter.HighlightingStateChanged"/>
/// </summary> /// </summary>

2
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs

@ -251,7 +251,7 @@ namespace ICSharpCode.SharpDevelop.Gui
public void AddCategory(MessageViewCategory category) public void AddCategory(MessageViewCategory category)
{ {
if (WorkbenchSingleton.InvokeRequired) { if (WorkbenchSingleton.InvokeRequired) {
SD.MainThread.InvokeAsync(() => (Action<MessageViewCategory>)AddCategory(category)).FireAndForget(); SD.MainThread.InvokeAsync(() => AddCategory(category)).FireAndForget();
return; return;
} }
messageCategories.Add(category); messageCategories.Add(category);

19
src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs

@ -26,6 +26,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Gets the main form. Returns null in unit-testing mode. /// Gets the main form. Returns null in unit-testing mode.
/// </summary> /// </summary>
[Obsolete("Use SD.WinForms.MainWin32Window instead")]
public static IWin32Window MainWin32Window { public static IWin32Window MainWin32Window {
get { get {
if (workbench != null) { if (workbench != null) {
@ -38,6 +39,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Gets the main window. Returns null in unit-testing mode. /// Gets the main window. Returns null in unit-testing mode.
/// </summary> /// </summary>
[Obsolete("Use SD.Workbench.MainWindow instead")]
public static Window MainWindow { public static Window MainWindow {
get { get {
if (workbench != null) { if (workbench != null) {
@ -50,6 +52,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Gets the workbench. Returns null in unit-testing mode. /// Gets the workbench. Returns null in unit-testing mode.
/// </summary> /// </summary>
[Obsolete("Use SD.Workbench instead")]
public static IWorkbench Workbench { public static IWorkbench Workbench {
get { get {
return workbench; return workbench;
@ -63,7 +66,7 @@ namespace ICSharpCode.SharpDevelop.Gui
} }
} }
public static void InitializeWorkbench(IWorkbench workbench, IWorkbenchLayout layout) internal static void InitializeWorkbench(IWorkbench workbench, IWorkbenchLayout layout)
{ {
WorkbenchSingleton.workbench = workbench; WorkbenchSingleton.workbench = workbench;
SD.Services.AddService(typeof(IWorkbench), workbench); SD.Services.AddService(typeof(IWorkbench), workbench);
@ -107,7 +110,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// Runs workbench cleanup. /// Runs workbench cleanup.
/// Is called by ICSharpCode.SharpDevelop.Sda and should not be called manually! /// Is called by ICSharpCode.SharpDevelop.Sda and should not be called manually!
/// </summary> /// </summary>
public static void OnWorkbenchUnloaded() internal static void OnWorkbenchUnloaded()
{ {
if (!Project.ProjectService.IsClosingCanceled()) { if (!Project.ProjectService.IsClosingCanceled()) {
Project.ProjectService.CloseSolution(); Project.ProjectService.CloseSolution();
@ -132,6 +135,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// For performance reasons, the thread check is only done in debug builds. /// For performance reasons, the thread check is only done in debug builds.
/// </summary> /// </summary>
[Conditional("DEBUG")] [Conditional("DEBUG")]
[Obsolete("Use SD.MainThread.VerifyAccess() instead")]
internal static void DebugAssertMainThread() internal static void DebugAssertMainThread()
{ {
SD.MainThread.VerifyAccess(); SD.MainThread.VerifyAccess();
@ -140,6 +144,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Throws an exception if the current thread is not the main thread. /// Throws an exception if the current thread is not the main thread.
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.VerifyAccess() instead")]
public static void AssertMainThread() public static void AssertMainThread()
{ {
if (InvokeRequired) { if (InvokeRequired) {
@ -154,6 +159,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// operation, which can result in a dead-lock when the main thread waits for a lock /// operation, which can result in a dead-lock when the main thread waits for a lock
/// held by this thread! /// held by this thread!
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeIfRequired() instead")]
public static R SafeThreadFunction<R>(Func<R> method) public static R SafeThreadFunction<R>(Func<R> method)
{ {
return SD.MainThread.InvokeIfRequired(method); return SD.MainThread.InvokeIfRequired(method);
@ -164,6 +170,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// operation, which can result in a dead-lock when the main thread waits for a lock /// operation, which can result in a dead-lock when the main thread waits for a lock
/// held by this thread! /// held by this thread!
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeIfRequired() instead")]
public static R SafeThreadFunction<A, R>(Func<A, R> method, A arg1) public static R SafeThreadFunction<A, R>(Func<A, R> method, A arg1)
{ {
return SD.MainThread.InvokeIfRequired(() => method(arg1)); return SD.MainThread.InvokeIfRequired(() => method(arg1));
@ -174,6 +181,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// operation, which can result in a dead-lock when the main thread waits for a lock /// operation, which can result in a dead-lock when the main thread waits for a lock
/// held by this thread! /// held by this thread!
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeIfRequired() instead")]
public static void SafeThreadCall(Action method) public static void SafeThreadCall(Action method)
{ {
SD.MainThread.InvokeIfRequired(method); SD.MainThread.InvokeIfRequired(method);
@ -184,6 +192,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// operation, which can result in a dead-lock when the main thread waits for a lock /// operation, which can result in a dead-lock when the main thread waits for a lock
/// held by this thread! /// held by this thread!
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeIfRequired() instead")]
public static void SafeThreadCall<A>(Action<A> method, A arg1) public static void SafeThreadCall<A>(Action<A> method, A arg1)
{ {
SD.MainThread.InvokeIfRequired(() => method(arg1)); SD.MainThread.InvokeIfRequired(() => method(arg1));
@ -194,6 +203,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// operation, which can result in a dead-lock when the main thread waits for a lock /// operation, which can result in a dead-lock when the main thread waits for a lock
/// held by this thread! /// held by this thread!
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeIfRequired() instead")]
public static void SafeThreadCall<A, B>(Action<A, B> method, A arg1, B arg2) public static void SafeThreadCall<A, B>(Action<A, B> method, A arg1, B arg2)
{ {
SD.MainThread.InvokeIfRequired(() => method(arg1, arg2)); SD.MainThread.InvokeIfRequired(() => method(arg1, arg2));
@ -204,6 +214,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// operation, which can result in a dead-lock when the main thread waits for a lock /// operation, which can result in a dead-lock when the main thread waits for a lock
/// held by this thread! /// held by this thread!
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeIfRequired() instead")]
public static void SafeThreadCall<A, B, C>(Action<A, B, C> method, A arg1, B arg2, C arg3) public static void SafeThreadCall<A, B, C>(Action<A, B, C> method, A arg1, B arg2, C arg3)
{ {
SD.MainThread.InvokeIfRequired(() => method(arg1, arg2, arg3)); SD.MainThread.InvokeIfRequired(() => method(arg1, arg2, arg3));
@ -212,6 +223,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Makes a call GUI threadsafe without waiting for the returned value. /// Makes a call GUI threadsafe without waiting for the returned value.
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeAsync().FireAndForget() instead")]
public static void SafeThreadAsyncCall(Action method) public static void SafeThreadAsyncCall(Action method)
{ {
SD.MainThread.InvokeAsync(method).FireAndForget(); SD.MainThread.InvokeAsync(method).FireAndForget();
@ -220,6 +232,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Makes a call GUI threadsafe without waiting for the returned value. /// Makes a call GUI threadsafe without waiting for the returned value.
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeAsync().FireAndForget() instead")]
public static void SafeThreadAsyncCall<A>(Action<A> method, A arg1) public static void SafeThreadAsyncCall<A>(Action<A> method, A arg1)
{ {
SD.MainThread.InvokeAsync(() => method(arg1)).FireAndForget(); SD.MainThread.InvokeAsync(() => method(arg1)).FireAndForget();
@ -228,6 +241,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Makes a call GUI threadsafe without waiting for the returned value. /// Makes a call GUI threadsafe without waiting for the returned value.
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeAsync().FireAndForget() instead")]
public static void SafeThreadAsyncCall<A, B>(Action<A, B> method, A arg1, B arg2) public static void SafeThreadAsyncCall<A, B>(Action<A, B> method, A arg1, B arg2)
{ {
SD.MainThread.InvokeAsync(() => method(arg1, arg2)).FireAndForget(); SD.MainThread.InvokeAsync(() => method(arg1, arg2)).FireAndForget();
@ -236,6 +250,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Makes a call GUI threadsafe without waiting for the returned value. /// Makes a call GUI threadsafe without waiting for the returned value.
/// </summary> /// </summary>
[Obsolete("Use SD.MainThread.InvokeAsync().FireAndForget() instead")]
public static void SafeThreadAsyncCall<A, B, C>(Action<A, B, C> method, A arg1, B arg2, C arg3) public static void SafeThreadAsyncCall<A, B, C>(Action<A, B, C> method, A arg1, B arg2, C arg3)
{ {
SD.MainThread.InvokeAsync(() => method(arg1, arg2, arg3)).FireAndForget(); SD.MainThread.InvokeAsync(() => method(arg1, arg2, arg3)).FireAndForget();

Loading…
Cancel
Save