annotate SilverlightValidation/SilverlightGlimpse/Controls/ExceptionsViewer.xaml.cs @ 58:241e2f22ed3c

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