From da8f935ec4c1ea54e7e7cd4c2fbffe4841cc146f Mon Sep 17 00:00:00 2001 From: Rafael Rosa Date: Thu, 17 Oct 2024 11:12:30 -0300 Subject: [PATCH] chore: move KeepAliveIdeMessage to IDEChannelClient --- src/Uno.UI.RemoteControl.VS/EntryPoint.cs | 3 --- .../IDEChannel/IDEChannelClient.cs | 18 +++++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Uno.UI.RemoteControl.VS/EntryPoint.cs b/src/Uno.UI.RemoteControl.VS/EntryPoint.cs index 849307420666..8f619ffea681 100644 --- a/src/Uno.UI.RemoteControl.VS/EntryPoint.cs +++ b/src/Uno.UI.RemoteControl.VS/EntryPoint.cs @@ -426,9 +426,6 @@ private async Task OnMessageReceivedAsync(object? sender, IdeMessage devServerMe { switch (devServerMessage) { - case KeepAliveIdeMessage: - _debugAction?.Invoke($"Keep alive from Dev Server"); - break; case AddMenuItemRequestIdeMessage amir: await OnAddMenuItemRequestIdeMessageAsync(sender, amir); break; diff --git a/src/Uno.UI.RemoteControl.VS/IDEChannel/IDEChannelClient.cs b/src/Uno.UI.RemoteControl.VS/IDEChannel/IDEChannelClient.cs index d4af83541f90..b665647b8b09 100644 --- a/src/Uno.UI.RemoteControl.VS/IDEChannel/IDEChannelClient.cs +++ b/src/Uno.UI.RemoteControl.VS/IDEChannel/IDEChannelClient.cs @@ -89,14 +89,18 @@ private void ProcessDevServerMessage(object sender, IdeMessageEnvelope devServer _logger.Verbose($"IDE: IDEChannel message received {devServerMessage}"); var process = Task.CompletedTask; - if (devServerMessage is IdeMessage message) + switch (devServerMessage) { - _logger.Verbose($"Dev Server Message {message.GetType()} requested"); - process = OnMessageReceived.InvokeAsync(this, message); - } - else - { - _logger.Verbose($"Unknown message type {devServerMessage?.GetType()} from DevServer"); + case KeepAliveIdeMessage: + _logger.Verbose($"Keep alive from Dev Server"); + break; + case IdeMessage message: + _logger.Verbose($"Dev Server Message {message.GetType()} requested"); + process = OnMessageReceived.InvokeAsync(this, message); + break; + default: + _logger.Verbose($"Unknown message type {devServerMessage?.GetType()} from DevServer"); + break; } _ = process.ContinueWith(