public static void Show(Window owner, IEnumerable <string> imessages, IEnumerable <Exception> iexceptions) { string split = Environment.NewLine + "--------------------" + Environment.NewLine; var messages = imessages.ToList(); var exceptions = iexceptions.ToList(); bool isconnerror = exceptions.All(e => (e as RestException)?.IsConnectionProblem == true); var dlg = new SyncErrorDialog(); dlg.CbSupress.Visibility = isconnerror ? Visibility.Visible : Visibility.Collapsed; dlg.ErrorMessage.Text = string.Join(Environment.NewLine, messages); dlg.ErrorTrace.Text = string.Join(split, exceptions.Select(FormatExecption)); if (owner != null && owner.IsLoaded) { dlg.Owner = owner; } else { dlg.WindowStartupLocation = WindowStartupLocation.CenterScreen; } dlg.ShowDialog(); if (isconnerror && dlg.CbSupress.IsChecked == true) { MainWindow.Instance.Settings.SuppressConnectionProblemPopup = true; MainWindow.Instance.Settings.Save(); } }
public static void Show(Window owner, Exception e) { var dlg = new SyncErrorDialog(); dlg.ErrorMessage.Text = e.Message; dlg.ErrorTrace.Text = FormatExecption(e); dlg.Owner = owner; dlg.ShowDialog(); }
public static void Show(Window owner, string message, string trace) { var dlg = new SyncErrorDialog(); dlg.ErrorMessage.Text = message; dlg.ErrorTrace.Text = trace; SetOwnerSafe(owner, dlg); dlg.ShowDialog(); }
public static void Show(Window owner, string message, string trace) { var dlg = new SyncErrorDialog(); dlg.ErrorMessage.Text = message; dlg.ErrorTrace.Text = trace; if (owner != null && owner.IsLoaded) { dlg.Owner = owner; } else { dlg.WindowStartupLocation = WindowStartupLocation.CenterScreen; } dlg.ShowDialog(); }