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