private async void KeyTestFlyoutOpened(object sender, object e)
        {
            this.keyTestResultTextBox.Text = "";

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.FaceApiKey)
                ? CallApiAndReportResult("Face API Test: ", async() => await CognitiveServiceApiKeyTester.TestFaceApiKeyAsync(
                                             SettingsHelper.Instance.FaceApiKey, SettingsHelper.Instance.FaceApiKeyEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.VisionApiKey)
                ? CallApiAndReportResult("Computer Vision API Test: ", async() => await CognitiveServiceApiKeyTester.TestComputerVisionApiKeyAsync(
                                             SettingsHelper.Instance.VisionApiKey, SettingsHelper.Instance.VisionApiKeyEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.BingSearchApiKey)
                ? CallApiAndReportResult("Bing Search API Test: ", async() => await CognitiveServiceApiKeyTester.TestBingSearchApiKeyAsync(SettingsHelper.Instance.BingSearchApiKey))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.BingAutoSuggestionApiKey)
                ? CallApiAndReportResult("Bing Auto Suggestion API Test: ", async() => await CognitiveServiceApiKeyTester.TestBingAutosuggestApiKeyAsync(SettingsHelper.Instance.BingAutoSuggestionApiKey))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.TextAnalyticsKey)
                ? CallApiAndReportResult("Text Analytics API Test: ", async() => await CognitiveServiceApiKeyTester.TestTextAnalyticsApiKeyAsync(
                                             SettingsHelper.Instance.TextAnalyticsKey, SettingsHelper.Instance.TextAnalyticsApiKeyEndpoint))
                : Task.CompletedTask);
        }
Exemple #2
0
        private async void KeyTestFlyoutOpened(object sender, object e)
        {
            this.keyTestResultTextBox.Text = "";

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.FaceApiKey)
                ? CallApiAndReportResult("Face API Test: ", async() => await CognitiveServiceApiKeyTester.TestFaceApiKeyAsync(
                                             SettingsHelper.Instance.FaceApiKey, SettingsHelper.Instance.FaceApiKeyEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.VisionApiKey)
                ? CallApiAndReportResult("Computer Vision API Test: ", async() => await CognitiveServiceApiKeyTester.TestComputerVisionApiKeyAsync(
                                             SettingsHelper.Instance.VisionApiKey, SettingsHelper.Instance.VisionApiKeyEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.CustomVisionTrainingApiKey)
                ? CallApiAndReportResult("Custom Vision Training API Test: ", async() => await CognitiveServiceApiKeyTester.TestCustomVisionTrainingApiKeyAsync(
                                             SettingsHelper.Instance.CustomVisionTrainingApiKey, SettingsHelper.Instance.CustomVisionTrainingApiKeyEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.BingSearchApiKey)
                ? CallApiAndReportResult("Bing Search API Test: ", async() => await CognitiveServiceApiKeyTester.TestBingSearchApiKeyAsync(SettingsHelper.Instance.BingSearchApiKey))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.TextAnalyticsKey)
                ? CallApiAndReportResult("Text Analytics API Test: ", async() => await CognitiveServiceApiKeyTester.TestTextAnalyticsApiKeyAsync(
                                             SettingsHelper.Instance.TextAnalyticsKey, SettingsHelper.Instance.TextAnalyticsApiKeyEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.TranslatorTextApiKey)
                ? CallApiAndReportResult("Translator Text API Test: ", async() => await CognitiveServiceApiKeyTester.TestTranslatorTextApiKeyAsync(SettingsHelper.Instance.TranslatorTextApiKey, SettingsHelper.Instance.TranslatorTextApiRegion))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.AnomalyDetectorApiKey)
                ? CallApiAndReportResult("Anomaly Detector API Test: ", async() => await CognitiveServiceApiKeyTester.TestAnomalyDetectorApiKeyAsync(SettingsHelper.Instance.AnomalyDetectorApiKey, SettingsHelper.Instance.AnomalyDetectorKeyEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.SpeechApiKey)
                ? CallApiAndReportResult("Speech API Test: ", async() => await CognitiveServiceApiKeyTester.TestSpeechApiKeyAsync(
                                             SettingsHelper.Instance.SpeechApiKey, SettingsHelper.Instance.SpeechApiEndpoint))
                : Task.CompletedTask);

            await(!string.IsNullOrEmpty(SettingsHelper.Instance.FormRecognizerApiKey)
                ? CallApiAndReportResult("Form Recognizer API Test: ", async() => await CognitiveServiceApiKeyTester.TestFormRecognizerApiKeyAsync(
                                             SettingsHelper.Instance.FormRecognizerApiKey, SettingsHelper.Instance.FormRecognizerApiKeyEndpoint))
                : Task.CompletedTask);
        }