|
@@ -1,12 +1,13 @@
|
|
using System;
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel;
|
|
|
|
+using System.Diagnostics;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.CompilerServices;
|
|
-using System.Runtime.ExceptionServices;
|
|
|
|
using System.Threading;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
namespace Avalonia.Threading;
|
|
namespace Avalonia.Threading;
|
|
|
|
|
|
|
|
+[DebuggerDisplay("{DebugDisplay}")]
|
|
public class DispatcherOperation
|
|
public class DispatcherOperation
|
|
{
|
|
{
|
|
protected readonly bool ThrowOnUiThread;
|
|
protected readonly bool ThrowOnUiThread;
|
|
@@ -25,7 +26,7 @@ public class DispatcherOperation
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- protected object? Callback;
|
|
|
|
|
|
+ protected internal object? Callback;
|
|
protected object? TaskSource;
|
|
protected object? TaskSource;
|
|
|
|
|
|
internal DispatcherOperation? SequentialPrev { get; set; }
|
|
internal DispatcherOperation? SequentialPrev { get; set; }
|
|
@@ -53,6 +54,16 @@ public class DispatcherOperation
|
|
Dispatcher = dispatcher;
|
|
Dispatcher = dispatcher;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ internal string DebugDisplay
|
|
|
|
+ {
|
|
|
|
+ get
|
|
|
|
+ {
|
|
|
|
+ var method = (Callback as Delegate)?.Method;
|
|
|
|
+ var methodDisplay = method is null ? "???" : method.DeclaringType + "." + method.Name;
|
|
|
|
+ return $"{methodDisplay} [{Priority}]";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// An event that is raised when the operation is aborted or canceled.
|
|
/// An event that is raised when the operation is aborted or canceled.
|
|
/// </summary>
|
|
/// </summary>
|