Example #1
0
            internal SqlEventMessage(MssqlMessageReader messageReader, int id, string eventName, string source,
                                     string type, string method, string message, System.DateTime time, string exceptionXml)
                :       base(eventName, source, type, method, message, time, null)
            {
                _id            = id;
                _messageReader = messageReader;

                // Deserialize the exception immediately. This slows down the message reader a bit, but
                // storing them as XML is a huge memory overhead. If an exception occurs don't completely
                // fail, just store the exception to be re-thrown when the user accesses the Details property.

                try
                {
                    ExceptionInfo exception = (string.IsNullOrEmpty(exceptionXml) ? null :
                                               ExceptionInfo.FromXmlString(exceptionXml));
                    SetException(exception);
                }
                catch (System.Exception ex)
                {
                    _exceptionException = ex;
                }
            }