private void ok_btn_Click(object sender, RoutedEventArgs e) { if (configs != null) { // Take the video source from the info_config textbox try { VideoEncoder2Configuration vec = JsonConvert.DeserializeObject <VideoEncoder2Configuration>(info_config.Text); media.SetVideoEncoderConfiguration(vec); } catch (Exception ex) { error_log.Visibility = Visibility.Visible; error_log.Content = "Error in the JSON format!"; error_log.Foreground = new SolidColorBrush(Colors.Red); return; } ConfigurationRef[] config = { new ConfigurationRef() }; config[0].Type = "VideoEncoder"; config[0].Token = configs[selectedIndex].token; media.AddConfiguration(profileToken, profileName, config); this.DialogResult = true; } else { this.DialogResult = false; } this.Close(); }
private void ok_btn_Click(object sender, RoutedEventArgs e) { if (configs != null) { try { AudioSourceConfiguration asc = JsonConvert.DeserializeObject <AudioSourceConfiguration>(info_config.Text); media.SetAudioSourceConfiguration(asc); } catch (Exception ex) { error_log.Visibility = Visibility.Visible; error_log.Content = "Error in the JSON format!"; error_log.Foreground = new SolidColorBrush(Colors.Red); return; } ConfigurationRef[] config = { new ConfigurationRef() }; config[0].Type = "AudioSource"; config[0].Token = configs[selectedIndex].token; media.AddConfiguration(profileToken, profileName, config); } this.DialogResult = true; this.Close(); }