aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs57
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/ISystemInfoService.cs8
2 files changed, 31 insertions, 34 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)
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/ISystemInfoService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/ISystemInfoService.cs
index 0cc493891..47ea7bd4b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/ISystemInfoService.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/ISystemInfoService.cs
@@ -6,8 +6,12 @@ using System.Threading.Tasks;
namespace Tango.PPC.Common.SystemInfo
{
- public interface ISystemInfoService
+ /// <summary>
+ /// Represents a PPC system information service.
+ /// </summary>
+ /// <seealso cref="Tango.PPC.Common.IPPCService" />
+ public interface ISystemInfoService : IPPCService
{
- bool Enabled { get; set; }
+
}
}