diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs index ef8e31bce..f80a8be1e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs @@ -33,30 +33,28 @@ namespace Tango.PPC.Common.SystemInfo externalBridge.RegisterRequestHandler(this); } - [ExternalBridgeRequestHandlerMethod(typeof(GetMachineInformationRequest))] - public async void OnGetMachineInformationRequest(GetMachineInformationRequest request, String token, ExternalBridgeReceiver receiver) + [ExternalBridgeRequestHandlerMethod(typeof(GetMachineInformationRequest), RequestHandlerLoggingMode.LogRequestName)] + public async Task OnGetMachineInformationRequest(GetMachineInformationRequest request, String token, ExternalBridgeReceiver receiver) { - try + if (response == null) { - if (response == null) - { - //Get the networks that are currently connected to - var connectedNetwork = NetworkListManager.GetNetworks(NetworkConnectivityLevels.Connected).FirstOrDefault(); + //Get the networks that are currently connected to + var connectedNetwork = NetworkListManager.GetNetworks(NetworkConnectivityLevels.Connected).FirstOrDefault(); - var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); - List<SystemObjectsCollection> system = new List<SystemObjectsCollection>(); + List<SystemObjectsCollection> system = new List<SystemObjectsCollection>(); - if (!Debugger.IsAttached) - { - system = SystemObjectsCollection.Create(); - } + if (!Debugger.IsAttached) + { + system = SystemObjectsCollection.Create(); + } - //Add custom information.. - system.Insert(0, new SystemObjectsCollection() - { - Name = "Application", - Objects = new List<SystemObject>() + //Add custom information.. + system.Insert(0, new SystemObjectsCollection() + { + Name = "Application", + Objects = new List<SystemObject>() { new SystemObject() { @@ -112,23 +110,18 @@ namespace Tango.PPC.Common.SystemInfo }.OrderBy(x => x.Name).ToList(), }, }, - }); + }); - response = new GetMachineInformationResponse() + response = new GetMachineInformationResponse() + { + Package = new InformationPackage() { - Package = new InformationPackage() - { - System = system, - } - }; - } - - await receiver.SendGenericResponse(response, token); - } - catch (Exception ex) - { - LogManager.Log(ex, "Error sending system information."); + System = system, + } + }; } + + await receiver.SendGenericResponse(response, token); } public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) |
