private void checkBoxAudio_Click(object sender, RoutedEventArgs e) { CheckBox checkBox = sender as CheckBox; if (checkBox != null) { var taskStuff = checkBox.DataContext as TaskStuff; if (taskStuff == null) { return; } if (checkBox.IsChecked == true) { string displayFile = TaskStuffFileHelper.GetDisplayFile(taskStuff); if (displayFile.EndsWith(".mp3", StringComparison.OrdinalIgnoreCase) || displayFile.EndsWith(".wav", StringComparison.OrdinalIgnoreCase)) { CO_IA.Client.AudioPlayer.Play(checkBox, new Uri(displayFile, UriKind.RelativeOrAbsolute), () => { checkBox.IsChecked = false; }); } } else { CO_IA.Client.AudioPlayer.Stop(); } } }
private void FileDescriptionOpenCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) { TaskStuffFileHelper.OpenFile(sender, e, this); }