/// <summary> /// Handles initialization error(invalid license) /// </summary> /// <param name="errorType">initialization error type(only INVALID_LICENSE_KEY at the moment)</param> void mRecognizer_OnInitializationError(InitializationErrorType errorType) { // handle licensing error by displaying error message and terminating the application if (errorType == InitializationErrorType.INVALID_LICENSE_KEY) { MessageBox.Show("Could not unlock API! Invalid license key!\nThe application will now terminate!"); Application.Current.Terminate(); } else { // there are no other error types throw new NotImplementedException(); } }