I have the following code:
static void Main(string[] args)
{
moHost = new Host(
APIServerType.Simulator,
"T4Example",
"112A04B0-5AAF-42F4-994E-FA7CB959C60B",
"CTS",
"myUser",
"myPass"); //automated login
moHost = Host.Login(
APIServerType.Simulator,
"T4Example",
"112A04B0-5AAF-42F4-994E-FA7CB959C60B"); //manual login window
moAccounts = moHost.Accounts;
System.Console.WriteLine(moAccounts.ToString());
}
Where I know that the first automated login is an asynchronous request sent that I need to "wait" for.
And the login success would trigger:
public event Host.LoginSuccessEventHandler LoginSuccess
While a login failure would trigger:
public event Host.LoginFailureEventHandler LoginFailure
And a generic notification would be triggered by:
public event Host.NotificationEventHandler Notification
How do I go about handling this and properly waiting for my login success or failure?
The first automated login attempt does not show me as connected while the second manual login window indeed succeeds (therefore I am okay to think my credentials are fine and now its just that the code didn't properly 'wait').