58
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 using System;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2 using System.Windows;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3 using SilverlightGlimpse.Models;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 using System.Windows.Controls;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 namespace SilverlightGlimpse.Controls
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 public partial class ExceptionsViewer
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 public ExceptionsViewer()
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 InitializeComponent();
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 private void ClearExceptions_Click(object sender, RoutedEventArgs e)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 GlimpseService.CreateInstance.HostExceptions.Clear();
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 private void ExceptionsViewer_Loaded(object sender, RoutedEventArgs e)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 this.DataContext = GlimpseService.CreateInstance.HostExceptions;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 if (GlimpseService.CreateInstance.HostExceptions.Count > 0)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 this.lbExceptions.SelectedIndex = 0;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 private void lbExceptions_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29 if (this.lbExceptions.SelectedItem != null && this.lbExceptions.SelectedItem is ExceptionWrapper)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
30 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
31 if (((ExceptionWrapper)this.lbExceptions.SelectedItem).IsValidationException)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
32 this.tbAction.Visibility = Visibility.Visible;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
33 else
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
34 this.tbAction.Visibility = Visibility.Collapsed;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
35 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
36 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
37 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38 } |