using System; using System.Net; using StackExchange.Exceptional; namespace VisualizerExamples.DebuggerVisualizer.ViewModels { [Serializable] public class ExceptionViewModel : ExceptionViewModel { public ExceptionViewModel(System.Exception ex):base(ex) { } } [Serializable] public class ExceptionViewModel where T: System.Exception { /// /// The original Exception /// protected readonly T Exception; public ExceptionViewModel(T ex) { Exception = ex; } public string Message => Exception.Message; public string StackTrace => Exception.ToString(); public string StackTraceFormatted { get { var html = "
" +
                           ExceptionalUtils.StackTrace.HtmlPrettify(StackTrace, new StackTraceSettings())
                           +"
"; return html; } } } }