private static ExceptionInfo ConvertExceptionInfo(Loupe.Extensibility.Data.ILogMessage message)
        {
            if (message.HasException == false)
            {
                return(null);
            }

            return(new ExceptionInfo(message.Exception));
        }
        /// <summary>
        /// Returns a value indicating whether this log message is the same as another specified log message.
        /// </summary>
        /// <param name="other">Another log message to compare this log message to.</param>
        /// <returns></returns>
        public bool Equals(Loupe.Extensibility.Data.ILogMessage other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            return(Id.Equals(other.Id));
        }
        /// <summary>
        /// Compares the current object with another object of the same type.
        /// </summary>
        /// <returns>
        /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
        ///                     Value
        ///                     Meaning
        ///                     Less than zero
        ///                     This object is less than the <paramref name="other"/> parameter.
        ///                     Zero
        ///                     This object is equal to <paramref name="other"/>.
        ///                     Greater than zero
        ///                     This object is greater than <paramref name="other"/>.
        /// </returns>
        /// <param name="other">An object to compare with this object.
        ///                 </param>
        public int CompareTo(Loupe.Extensibility.Data.ILogMessage other)
        {
            int compare = Timestamp.CompareTo(other.Timestamp); // Compare by timestamp first, which works across sessions.

            if (compare == 0)
            {
                compare = Sequence.CompareTo(other.Sequence); // Break ties by sequence number.
            }
            if (compare == 0)
            {
                compare = Id.CompareTo(other.Id); // Final tie-break by Guid.
            }
            return(compare);
        }
        /// <summary>
        /// Returns a value indicating whether this log message is the same as another specified object.
        /// </summary>
        /// <param name="obj">Another object to compare this log message to.</param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(obj, null))
            {
                return(false); // We can't be equal to a null.
            }
            ILogMessage other = obj as ILogMessage;

            if (ReferenceEquals(other, null) == false)
            {
                return(Equals(other));
            }

            Loupe.Extensibility.Data.ILogMessage otherInternal = obj as Loupe.Extensibility.Data.ILogMessage;
            if (ReferenceEquals(other, null) == false)
            {
                return(Equals(otherInternal));
            }

            return(false); // Can't be equal to something that isn't an ILogMessage or a Data.ILogMessage.
        }
 internal LogMessageInfo(Loupe.Extensibility.Data.ILogMessage message)
 {
     m_Message   = message;
     m_Exception = ConvertExceptionInfo(message);
 }