From d2cd58fa3964307989691d9b58c82aef18ede89e Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Tue, 7 Jun 2022 14:36:02 -0500 Subject: [PATCH] Switched debug bridge to events --- UIX.Debug/Bridge.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/UIX.Debug/Bridge.cs b/UIX.Debug/Bridge.cs index cef9cca..5f89dd3 100644 --- a/UIX.Debug/Bridge.cs +++ b/UIX.Debug/Bridge.cs @@ -12,6 +12,9 @@ namespace Microsoft.Iris.Debug { private readonly MemberRemote _memberRemote; + public event EventHandler InterpreterStep; + public event Action DispatcherStep; + public Bridge(RemotingMode mode) { // Pass the instance you want to remote into MemberRemote() with an ID that is identical on both machines for that instance. @@ -24,13 +27,13 @@ namespace Microsoft.Iris.Debug [RemoteMethod, RemoteOptions(RemotingDirection.HostToClient)] public void LogInterpreterOpCode(object context, Data.InterpreterEntry entry) { - System.Diagnostics.Debug.WriteLine($"[HOST] [Interpreter] [{context}] {entry}"); + InterpreterStep?.Invoke(context, new(entry)); } [RemoteMethod, RemoteOptions(RemotingDirection.HostToClient)] public void LogDispatcher(string message) { - System.Diagnostics.Debug.WriteLine($"[HOST] [Dispatcher] {message}"); + DispatcherStep?.Invoke(message); } public void Dispose()