view SilverlightGlimpse/Controls/LoadExceptionViewer.xaml.cs @ 60:fc62c971a117

upload to blog
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 21 Apr 2012 21:19:39 +0100
parents 3591c26bd63e
children
line wrap: on
line source

using System;

namespace SilverlightGlimpse.Controls
{
    public partial class LoadExceptionViewer
    {
        public LoadExceptionViewer()
        {
            InitializeComponent();
        }

        public LoadExceptionViewer(Exception e, string sourceLocation)
            : this()
        {
            this.txtSourceLocation.Text = string.Concat("Source Location: ", sourceLocation);

            Exception ex = e;

            while (ex != null)
            {
                this.lbExceptions.Items.Add(ex);
                ex = ex.InnerException;
            }

            if (this.lbExceptions.Items.Count > 0)
            {
                this.lbExceptions.SelectedIndex = 0;
            }
        }
    }
}