59
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 using System;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3 namespace SilverlightGlimpse.Controls
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 public partial class LoadExceptionViewer
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 public LoadExceptionViewer()
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 InitializeComponent();
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 public LoadExceptionViewer(Exception e, string sourceLocation)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 : this()
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 this.txtSourceLocation.Text = string.Concat("Source Location: ", sourceLocation);
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 Exception ex = e;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 while (ex != null)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 this.lbExceptions.Items.Add(ex);
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 ex = ex.InnerException;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 if (this.lbExceptions.Items.Count > 0)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 this.lbExceptions.SelectedIndex = 0;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
30 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
31 } |