/// <summary> /// Initializes a new instance of the <see cref="ExceptionTreeViewItemViewModel"/> class. /// </summary> /// <param name="parent"> /// The parent. /// </param> /// <param name="exception"> /// The exception. /// </param> /// <param name="additionalInfo"> /// The additional info. /// </param> public ExceptionTreeViewItemViewModel(TreeViewItemViewModel parent, Exception exception, string additionalInfo) : base(parent, string.Format(CultureInfo.InvariantCulture, "{0} {1}", exception == null ? string.Empty : exception.GetType().ToString(), exception), true) { this.AdditionalInfo = additionalInfo; this._exception = exception ?? throw new ArgumentNullException(nameof(exception)); if (this._exception is TargetInvocationException) { // for reflection exception look in inner exception. if (this._exception.InnerException != null) { this._exception = this._exception.InnerException; } } this.IsExpanded = true; }
/// <summary> /// Initializes a new instance of the <see cref="ChildChangedEventArgs"/> class. /// </summary> /// <param name="item"> /// The item. /// </param> public ChildChangedEventArgs(TreeViewItemViewModel item) { this.Item = item; }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionTreeViewItemViewModel"/> class. /// </summary> /// <param name="parent"> /// The parent. /// </param> /// <param name="exception"> /// The exception. /// </param> public ExceptionTreeViewItemViewModel(TreeViewItemViewModel parent, Exception exception) : this(parent, exception, null) { }
/// <summary> /// Initializes a new instance of the <see cref="ObjectTreeViewModel"/> class. /// </summary> /// <param name="parent"> /// Parent object. /// </param> /// <param name="name"> /// Name of the object. /// </param> /// <param name="obj"> /// Object value. /// </param> /// <param name="infoType"> /// Extracting information. /// </param> public ObjectTreeViewModel(TreeViewItemViewModel parent, string name, object obj, InfoType infoType) : this(parent, name, obj, infoType, 0) { }