diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs index ad4d28032..2a19ca146 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs @@ -94,9 +94,9 @@ private async void ConnectionStatusChangedHandler(object? sender, ConnectionInfo } } - connections = new List>() + connections = new Dictionary() { - new(_runtimeId, connection) + { _runtimeId, connection } }; } } @@ -106,8 +106,7 @@ private async void ConnectionStatusChangedHandler(object? sender, ConnectionInfo return; } - if (connections.Any()) - await _communicator.UpdateConnectionInformation(connections); + await _communicator.UpdateConnectionInformation(connections); } public async Task SendRuntimeInfo() @@ -116,9 +115,9 @@ public async Task SendRuntimeInfo() lock(_locker) { - runtimeInfo = new List>() + runtimeInfo = new Dictionary() { - new(_runtimeId, _processInformation) + { _runtimeId, _processInformation } }; } @@ -150,16 +149,13 @@ public async Task AddEnvironmentVariables(EnvironmentMonitorInfo environmentVari _processInformation.EnvironmentVariables.AddOrUpdate(env.Key, env.Value, (_, _) => env.Value); } - info = new List>>>() + info = new Dictionary>>() { - new(_runtimeId, environmentVariables.EnvironmentVariables) + { _runtimeId, environmentVariables.EnvironmentVariables } }; } - if (info.Any()) - { - await _communicator.UpdateEnvironmentVariableInformation(info); - } + await _communicator.UpdateEnvironmentVariableInformation(info); } private async Task AddOrUpdateElements( @@ -194,7 +190,7 @@ private async Task AddOrUpdateElements( } } - info = new List>>() { new(_runtimeId, source) }; + info = new Dictionary>() { { _runtimeId, source } }; } await handler(info);