59
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 Partial Public Class GlimpseViewer
|
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 Me.DataContext = GlimpseService.CreateInstance
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 AddHandler GlimpseService.CreateInstance.HostExceptions.CollectionChanged, AddressOf HostExceptions_CollectionChanged
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 Private Sub btnContract_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnContract.Click
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 Me.layoutViewer.Visibility = Windows.Visibility.Collapsed
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 Private Sub btnExpand_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnExpand.Click
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 Me.layoutViewer.Visibility = Windows.Visibility.Visible
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 Private Sub HostExceptions_CollectionChanged(ByVal sender As Object, ByVal e As System.Collections.Specialized.NotifyCollectionChangedEventArgs)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 Dim intUnhandledExceptionCount As Integer = 0
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 Dim intValidationExceptionCount As Integer = 0
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 For Each ew As ExceptionWrapper In GlimpseService.CreateInstance.HostExceptions
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 If ew.IsValidationException Then
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 intValidationExceptionCount += 1
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 Else
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29 intUnhandledExceptionCount += 1
|
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 Next
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
33
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
34 Me.tbValidationExceptions.Text = intValidationExceptionCount.ToString
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
35
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
36 If intValidationExceptionCount = 0 Then
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
37 Me.elpValidationExceptions.Fill = Me.noExceptionsBrush
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
39 Else
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
40 Me.elpValidationExceptions.Fill = Me.hasExceptionsBrush
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
41 End If
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
42
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
43 Me.tbUnhandledExceptions.Text = intUnhandledExceptionCount.ToString
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
44
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
45 If intUnhandledExceptionCount = 0 Then
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
46 Me.elpUnhandledExceptions.Fill = Me.noExceptionsBrush
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
47
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
48 Else
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
49 Me.elpUnhandledExceptions.Fill = Me.hasExceptionsBrush
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
50 End If
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
51
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
52 End Sub
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
53
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
54 End Class
|