private async void SpeakerDetails_RevertSpeakerRequest(SpeakerContainer spk) { if (spk.IsOnline) { using (var wc = new WaitCursor()) { var s = await _transcription.Api.GetSpeaker(spk.Speaker.DBID); Speaker.MergeFrom(spk.Speaker, s); spk.ReloadSpeaker(); } } else { spk.DiscardChanges(); } }
private MessageBoxResult CheckChanges(SpeakerContainer sc) { if (!sc.Changed) { return(MessageBoxResult.OK); } var result = MessageBox.Show(string.Format(Properties.Strings.SpeakersManagerSpeakerApplyChangesDialogFormat, sc.FullName), Properties.Strings.SpeakersManagerSpeakerApplyChangesDialogQuestion, MessageBoxButton.YesNoCancel, MessageBoxImage.Question); var ss = sc.Speaker; if (result == MessageBoxResult.Yes) { bool saved = AsyncHelpers.RunSync(() => TrySaveSpeaker(sc)); if (!saved) { result = MessageBoxResult.No; } else { return(MessageBoxResult.Yes); } } if (result == MessageBoxResult.No) { if (NewSpeaker == sc.Speaker) { NewSpeaker = null; SpeakerProvider.DeleteSpeaker(ss); } sc.ReloadSpeaker(); return(MessageBoxResult.No); } return(MessageBoxResult.Cancel); }
private bool CheckChanges(SpeakerContainer sc) { if (!sc.Changed) return true; var result = MessageBox.Show(string.Format(Properties.Strings.SpeakersManagerSpeakerApplyChangesDialogFormat, sc.FullName), Properties.Strings.SpeakersManagerSpeakerApplyChangesDialogQuestion, MessageBoxButton.YesNo, MessageBoxImage.Question); ApiSynchronizedSpeaker ss = sc.Speaker as ApiSynchronizedSpeaker; if (result == MessageBoxResult.Yes) { bool saved = AsyncHelpers.RunSync(() => TrySaveSpeaker(sc)); if (!saved) { return false; } } else { if (NewSpeaker == sc.Speaker) { NewSpeaker = null; SpeakerProvider.DeleteSpeaker(ss); } sc.ReloadSpeaker(); return false; } return true; }
private MessageBoxResult CheckChanges(SpeakerContainer sc) { if (!sc.Changed) return MessageBoxResult.OK; var result = MessageBox.Show(string.Format(Properties.Strings.SpeakersManagerSpeakerApplyChangesDialogFormat, sc.FullName), Properties.Strings.SpeakersManagerSpeakerApplyChangesDialogQuestion, MessageBoxButton.YesNoCancel, MessageBoxImage.Question); var ss = sc.Speaker; if (result == MessageBoxResult.Yes) { bool saved = AsyncHelpers.RunSync(() => TrySaveSpeaker(sc)); if (!saved) { result = MessageBoxResult.No; }else return MessageBoxResult.Yes; } if (result == MessageBoxResult.No) { if (NewSpeaker == sc.Speaker) { NewSpeaker = null; SpeakerProvider.DeleteSpeaker(ss); } sc.ReloadSpeaker(); return MessageBoxResult.No; } return MessageBoxResult.Cancel; }