public FieldLogExceptionItemViewModel(FieldLogExceptionItem item)
        {
            this.Item = item;
            base.Item = item;

            this.ExceptionVM = new FieldLogExceptionViewModel(item.Exception);
            this.EnvironmentVM = new FieldLogEnvironmentViewModel(item.EnvironmentData, this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads the log item fields from the specified log file reader.
        /// </summary>
        /// <param name="reader">The log file reader to read from.</param>
        /// <returns>The read log item.</returns>
        internal static FieldLogExceptionItem Read(FieldLogFileReader reader)
        {
            FieldLogExceptionItem item = new FieldLogExceptionItem();

            item.ReadBaseData(reader);
            item.Exception       = FieldLogException.Read(reader);
            item.Context         = reader.ReadString();
            item.EnvironmentData = FieldLogEventEnvironment.Read(reader);
            return(item);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Reads a log item from the log file.
        /// </summary>
        /// <param name="reader">Log file reader.</param>
        /// <param name="type">The type of log item to read.</param>
        /// <returns>The read log item.</returns>
        internal static FieldLogItem Read(FieldLogFileReader reader, FieldLogItemType type)
        {
            switch (type)
            {
            case FieldLogItemType.Text:
                return(FieldLogTextItem.Read(reader));

            case FieldLogItemType.Data:
                return(FieldLogDataItem.Read(reader));

            case FieldLogItemType.Exception:
                return(FieldLogExceptionItem.Read(reader));

            case FieldLogItemType.Scope:
            case FieldLogItemType.RepeatedScope:
                return(FieldLogScopeItem.Read(reader, type == FieldLogItemType.RepeatedScope));
            }
            throw new ArgumentException("Unsupported log item type (" + (int)type + ")");
        }
Exemplo n.º 4
0
 /// <summary>
 /// Reads the log item fields from the specified log file reader.
 /// </summary>
 /// <param name="reader">The log file reader to read from.</param>
 /// <returns>The read log item.</returns>
 internal static FieldLogExceptionItem Read(FieldLogFileReader reader)
 {
     FieldLogExceptionItem item = new FieldLogExceptionItem();
     item.ReadBaseData(reader);
     item.Exception = FieldLogException.Read(reader);
     item.Context = reader.ReadString();
     item.EnvironmentData = FieldLogEventEnvironment.Read(reader);
     return item;
 }