Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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();
        }