This commit is contained in:
Samuele E. Locatelli
2019-03-06 13:00:23 +01:00
parent 337ef310ca
commit dc1c90558e
-71
View File
@@ -232,77 +232,6 @@ namespace TestClient
}), "");
});
}
#if false
/// <summary>
/// Task x AUTH
/// </summary>
/// <returns></returns>
private async Task doOAuthCycle()
{
StringBuilder sb = new StringBuilder();
// fino a quanod NON è auth --> cicla...
while (!reqStatus.isHmiEnrolled && doAuthSemap)
{
await Task.Run(() =>
{
synchronizationContext.Post(new SendOrPostCallback(o =>
{
sb = new StringBuilder();
sb.AppendLine("--------------------------------------------------");
sb.AppendLine(string.Format("{0:HH.mm.ss.fff} | Try OAuth process", DateTime.Now));
lblConsole.Text = sb.ToString();
}), "");
userAuthData authData = MCC.tryAuthorize();
// recupero nuova reqStatus...
reqStatus = MCC.reqStatusUpd;
synchronizationContext.Post(new SendOrPostCallback(o =>
{
// mostro i dati SPECIFICI x AUTH...
updateAuthData(authData);
// refresh...
sb = new StringBuilder();
sb.AppendLine(">>>");
sb.AppendLine(string.Format("{0:HH.mm.ss.fff} | END", DateTime.Now));
sb.AppendLine("--------------------------------------------------");
lblConsole.Text += sb.ToString();
}), "");
// mi fermo...
Thread.Sleep(500);
});
}
if (reqStatus.isHmiEnrolled)
{
// indico che ho concluso
sb = new StringBuilder();
sb.AppendLine("--------------------------------------------------");
sb.AppendLine(string.Format("{0:HH.mm.ss.fff} | Auth + enroll DONE", DateTime.Now));
sb.AppendLine("--------------------------------------------------");
synchronizationContext.Post(new SendOrPostCallback(o =>
{
lblConsole.Text = sb.ToString();
refreshRequestStatus();
}), "");
}
else
{
// indico che ho concluso
sb = new StringBuilder();
sb.AppendLine("--------------------------------------------------");
sb.AppendLine(string.Format("{0:HH.mm.ss.fff} | FORCE RESET", DateTime.Now));
sb.AppendLine("--------------------------------------------------");
synchronizationContext.Post(new SendOrPostCallback(o =>
{
lblConsole.Text = sb.ToString();
}), "");
resetAuthData();
}
doAuthSemap = false;
}
#endif
/// <summary>
/// Recupero OrgCode
/// </summary>