示例#1
0
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            string _endpoint = "";
            string _key      = "";

            try
            {
                _key = key.Text.Trim();
                string region = ((ComboBoxItem)endpoint.SelectedItem).Content.ToString().Trim();
                _endpoint = EndpointToUriConverter.azureRegionToEndpointMapping[region];
            }
            catch
            {
                MessageBox.Show("Key or Region cannot be empty!", "Invalid Input");
                return;
            }

            if (AzureRuntimeService.IsValidUserAccount(_key, _endpoint))
            {
                // Delete previous user account
                AzureAccount.GetInstance().Clear();
                AzureAccountStorageService.DeleteUserAccount();
                // Create and save new user account
                string _region = ((ComboBoxItem)endpoint.SelectedItem).Content.ToString().Trim();
                AzureAccount.GetInstance().SetUserKeyAndRegion(_key, _region);
                AzureAccountStorageService.SaveUserAccount(AzureAccount.GetInstance());
                AzureRuntimeService.IsAzureAccountPresentAndValid = true;
                SwitchViewToPreviousPage();
            }
            else
            {
                MessageBox.Show("Invalid Azure Account.\nIs your account expired?\nAre you connected to WiFi?");
            }
        }
        private void VoicePreviewButton_Click(object sender, RoutedEventArgs e)
        {
            AzureAccountStorageService.LoadUserAccount();
            AudioSettingsDialogWindow dialog = new AudioSettingsDialogWindow(AudioSettingsPage.AudioPreviewPage);
            AudioPreviewPage          page   = dialog.MainPage as AudioPreviewPage;

            page.PreviewDialogConfirmedHandler = OnSettingsDialogConfirmed;
            ConfigureAudioPreviewSettings(page);
            dialog.Title = "Audio Preview Window";
            dialog.ShowThematicDialog();
        }
示例#3
0
        protected override void ExecuteAction(string ribbonId)
        {
            LoadingDialogBox splashView = new LoadingDialogBox();

            splashView.Show();
            AzureAccountStorageService.LoadUserAccount();
            WatsonAccountStorageService.LoadUserAccount();
            AudioSettingStorageService.LoadAudioSettingPreference();
            splashView.Close();
            AudioSettingService.ShowSettingsDialog();
        }
 private void LogOutAzureAccountButton_Click(object sender, RoutedEventArgs e)
 {
     AzureAccount.GetInstance().Clear();
     AzureAccountStorageService.DeleteUserAccount();
     azureVoiceComboBox.Visibility = Visibility.Collapsed;
     azureVoiceBtn.Visibility      = Visibility.Visible;
     changeAcctBtn.Visibility      = Visibility.Hidden;
     logoutBtn.Visibility          = Visibility.Hidden;
     RadioAzureVoice.IsEnabled     = false;
     RadioDefaultVoice.IsChecked   = true;
     AzureRuntimeService.IsAzureAccountPresentAndValid = false;
 }
        protected override void ExecuteAction(string ribbonId)
        {
            LoadingDialogBox splashView = new LoadingDialogBox();

            splashView.Show();
            AzureAccountStorageService.LoadUserAccount();
            WatsonAccountStorageService.LoadUserAccount();
            AudioSettingStorageService.LoadAudioSettingPreference();
            splashView.Close();
            this.RegisterTaskPane(typeof(ELearningLabTaskpane), ELearningLabText.ELearningTaskPaneLabel,
                                  ELearningTaskPaneVisibleValueChangedEventHandler);
            CustomTaskPane eLearningTaskpane = this.GetTaskPane(typeof(ELearningLabTaskpane));

            eLearningTaskpane.Visible = !eLearningTaskpane.Visible;
        }
 protected override void ExecuteAction(string ribbonId)
 {
     AzureAccountStorageService.LoadUserAccount();
     AudioSettingStorageService.LoadAudioSettingPreference();
     AudioSettingService.ShowSettingsDialog();
 }