59
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 Partial Public Class ExceptionsViewer
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2 Inherits UserControl
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 Public Sub New()
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 InitializeComponent()
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 Private Sub ClearExceptions_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 GlimpseService.CreateInstance.HostExceptions.Clear()
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 Private Sub ExceptionsViewer_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 Me.DataContext = GlimpseService.CreateInstance.HostExceptions
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 If GlimpseService.CreateInstance.HostExceptions.Count > 0 Then
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 Me.lbExceptions.SelectedIndex = 0
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 End If
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 Private Sub lbExceptions_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 If Me.lbExceptions.SelectedItem IsNot Nothing AndAlso TypeOf Me.lbExceptions.SelectedItem Is ExceptionWrapper Then
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 If DirectCast(Me.lbExceptions.SelectedItem, ExceptionWrapper).IsValidationException Then
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 Me.tbAction.Visibility = Windows.Visibility.Visible
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 Else
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 Me.tbAction.Visibility = Windows.Visibility.Collapsed
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 End If
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
30 End If
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
31
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
32 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
33
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
34 End Class
|