aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-18 18:16:24 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-18 18:16:24 +0200
commit45829a9fb6f4b0d4443e22c972cf8543be533d4e (patch)
tree8255065ff8e3e7071dc53486870b1a0047d57d5a /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
parent78181d457b113c25e9ea55b378d6b6bd8e201338 (diff)
downloadTango-45829a9fb6f4b0d4443e22c972cf8543be533d4e.tar.gz
Tango-45829a9fb6f4b0d4443e22c972cf8543be533d4e.zip
Working on Tokens Manager.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs15
1 files changed, 6 insertions, 9 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
index b5140e336..256804f67 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
@@ -40,7 +40,6 @@ namespace Tango.PPC.Common.MachineSetup
private IRemoteAssistanceProvider _remoteAssistance;
private IUnifiedWriteFilterManager _uwf;
private IOperationSystemManager _windows_manager;
- private String _accessToken;
#region Events
@@ -84,19 +83,17 @@ namespace Tango.PPC.Common.MachineSetup
#region Private Methods
- private Task Login(String serialNumber)
+ private Task<String> Login(String serialNumber)
{
- return Task.Factory.StartNew(() =>
+ return Task.Factory.StartNew<String>(() =>
{
using (var client = new PPCWebService())
{
- var response = client.Login(new LoginRequest()
+ return client.Login(new LoginRequest()
{
Mode = LoginMode.Machine,
SerialNumber = serialNumber,
- }).Result;
-
- _accessToken = response.AccessToken;
+ }).Result.AccessToken;
}
});
}
@@ -128,10 +125,10 @@ namespace Tango.PPC.Common.MachineSetup
LogManager.Log($"Connecting to machine service on {machineServiceAddress}...");
- await Login(serialNumber);
+ var accessToken = await Login(serialNumber);
MachineSetupRequest request = new MachineSetupRequest();
- request.AccessToken = _accessToken;
+ request.AccessToken = accessToken;
MachineSetupResponse setup_response = null;