コード例 #1
0
ファイル: ErrorWindow.cs プロジェクト: wshanshan/DDD
 protected ErrorWindow(Exception ex, ICloseable parent)
 {
     InitializeComponent();
     textBoxName.Text = ex.Message;
     textBoxDetails.Text = ex.TargetSite.ToString();
     textBoxStackTrace.Text = ex.StackTrace;
 }
コード例 #2
0
ファイル: Application.cs プロジェクト: healtech/Perspex
 /// <summary>
 /// Runs the application's main loop until the <see cref="ICloseable"/> is closed.
 /// </summary>
 /// <param name="closable">The closable to track</param>
 public void Run(ICloseable closable)
 {
     var source = new CancellationTokenSource();
     closable.Closed += (s, e) => source.Cancel();
     Dispatcher.UIThread.MainLoop(source.Token);
 }
コード例 #3
0
ファイル: ErrorWindow.cs プロジェクト: wshanshan/DDD
 public static DialogResult ShowDialog(Exception ex, ICloseable parent)
 {
     ErrorWindow win = new ErrorWindow(ex, parent);
     return win.ShowDialog();
 }
コード例 #4
0
 /// <summary>
 /// Methods for when the Dialog Ok button is pressed
 /// </summary>
 /// <param name="parameter"></param>
 private void Ok(ICloseable parameter)
 {
     DialogResult = true;
     // Close this dialog
     parameter.Close();
 }
コード例 #5
0
 /// <summary>
 /// Methods for when the Dialog Cancel button is pressed
 /// </summary>
 /// <param name="parameter"></param>
 private void Cancel(ICloseable parameter)
 {
     DialogResult = false;
     // Close this dialog
     parameter.Close();
 }
コード例 #6
0
 private void CloseWindow(ICloseable window)
 {
     window?.Close();
 }
コード例 #7
0
        public static DialogResult ShowDialog(Exception ex, ICloseable parent)
        {
            ErrorWindow win = new ErrorWindow(ex, parent);

            return(win.ShowDialog());
        }
コード例 #8
0
 public MainWindow(ICloseable context)
 {
     InitializeComponent();
     context.CloseRequest += (s, e) => this.Close();
 }