//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Event notification for status of API initialization. </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// public void ttNetApiInitHandler(TTAPI api, ApiCreationException ex) { if (ex == null) { Console.WriteLine("TT .NET SDK Initialization Complete"); // Authenticate your credentials m_api = api; m_api.TTAPIStatusUpdate += new EventHandler <TTAPIStatusUpdateEventArgs>(m_api_TTAPIStatusUpdate); m_api.Start(); } else if (ex.IsRecoverable) { // this is in informational update from the SDK Console.WriteLine("TT.NET SDK Initialization Message: {0}", ex.Message); if (ex.Code == ApiCreationException.ApiCreationError.NewAPIVersionAvailable) { // a newer version of the SDK is available - notify someone to upgrade } } else { Console.WriteLine("TT.NET SDK Initialization Failed: {0}", ex.Message); if (ex.Code == ApiCreationException.ApiCreationError.NewAPIVersionRequired) { // do something to upgrade the SDK package since it will not start until it is upgraded // to the minimum version noted in the exception message } Dispose(); } }
private void OnSDKInitialized(TTAPI api, ApiCreationException ex) { if (ex == null) { lblStatus.Text = "Initialized. Authenticating..."; m_api = api; m_api.TTAPIStatusUpdate += OnSDKStatusUpdate; TTAPI.ShutdownCompleted += OnSDKShutdownComplete; m_api.Start(); } else if (!ex.IsRecoverable) { MessageBox.Show($"API Initialization Failed: {ex.Message}"); } }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Event notification for status of API initialization. </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// public void ttNetApiInitHandler(TTAPI api, ApiCreationException ex) { if (ex == null) { statusLabel.Text = "TT NET SDK INITIALIZED"; m_api = api; m_api.TTAPIStatusUpdate += new EventHandler <TTAPIStatusUpdateEventArgs>(m_api_TTAPIStatusUpdate); TTAPI.ShutdownCompleted += new EventHandler(TTAPI_ShutdownCompleted); m_api.Start(); } else if (ex.IsRecoverable) { // Initialization failed but retry is in progress... } else { MessageBox.Show("API Initialization Failed: " + ex.Message); } }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Event notification for status of API initialization. </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// public void ttNetApiInitHandler(TTAPI api, ApiCreationException ex) { if (ex == null) { Console.WriteLine("TT.NET SDK INITIALIZED"); // Authenticate your credentials m_apiInstance = api; m_apiInstance.TTAPIStatusUpdate += new EventHandler <TTAPIStatusUpdateEventArgs>(m_api_TTAPIStatusUpdate); m_apiInstance.Start(); } else if (ex.IsRecoverable) { // Initialization failed but retry is in progress... } else { Console.WriteLine("TT.NET SDK Initialization Failed: {0}", ex.Message); Dispose(); } }