Exemplo n.º 1
0
        /// <summary>
        /// Reads the exception fields from the specified log file reader.
        /// </summary>
        /// <param name="reader">The log file reader to read from.</param>
        /// <returns>The exception data.</returns>
        internal static FieldLogException Read(FieldLogFileReader reader)
        {
            FieldLogException ex = new FieldLogException();

            ex.Type = reader.ReadString();
            if (reader.FormatVersion >= 2)
            {
                ex.TypeModule = reader.ReadString();
                ex.Token      = reader.ReadInt32();
            }
            ex.Message = reader.ReadString();
            ex.Code    = reader.ReadInt32();
            ex.Data    = reader.ReadString();
            int frameCount = reader.ReadInt32();

            ex.StackFrames = new FieldLogStackFrame[frameCount];
            for (int i = 0; i < frameCount; i++)
            {
                ex.StackFrames[i] = FieldLogStackFrame.Read(reader);
            }
            int innerCount = reader.ReadInt32();

            ex.InnerExceptions = new FieldLogException[innerCount];
            for (int i = 0; i < innerCount; i++)
            {
                ex.InnerExceptions[i] = FieldLogException.Read(reader);
            }
            return(ex);
        }
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);
        }