示例#1
0
 internal MessageLogTraceRecord(Stream stream, System.ServiceModel.Diagnostics.MessageLoggingSource source) : this(source)
 {
     this.type = null;
     StringBuilder builder        = new StringBuilder();
     StreamReader  reader         = new StreamReader(stream);
     int           size           = 0x1000;
     char[]        buffer         = DiagnosticUtility.Utility.AllocateCharArray(size);
     int           maxMessageSize = MessageLogger.MaxMessageSize;
     if (-1 == maxMessageSize)
     {
         maxMessageSize = 0x1000;
     }
     while (maxMessageSize > 0)
     {
         int num3 = reader.Read(buffer, 0, size);
         if (num3 == 0)
         {
             break;
         }
         int charCount = (maxMessageSize < num3) ? maxMessageSize : num3;
         builder.Append(buffer, 0, charCount);
         maxMessageSize -= num3;
     }
     reader.Close();
     this.messageString = builder.ToString();
 }
示例#2
0
 internal MessageLogTraceRecord(ref System.ServiceModel.Channels.Message message, XmlReader reader, System.ServiceModel.Diagnostics.MessageLoggingSource source, bool logMessageBody) : this(source)
 {
     MessageBuffer buffer = null;
     try
     {
         this.logMessageBody = logMessageBody;
         this.message        = message;
         this.reader         = reader;
         this.type           = message.GetType();
     }
     finally
     {
         if (buffer != null)
         {
             buffer.Close();
         }
     }
 }
示例#3
0
 internal MessageLogTraceRecord(string message, System.ServiceModel.Diagnostics.MessageLoggingSource source) : this(source)
 {
     this.type          = null;
     this.messageString = message;
 }
示例#4
0
 internal MessageLogTraceRecord(ArraySegment <byte> buffer, System.ServiceModel.Diagnostics.MessageLoggingSource source) : this(source)
 {
     this.type          = null;
     this.messageString = Encoding.UTF8.GetString(buffer.Array, buffer.Offset, buffer.Count);
 }
示例#5
0
 private MessageLogTraceRecord(System.ServiceModel.Diagnostics.MessageLoggingSource source)
 {
     this.logMessageBody = true;
     this.source         = source;
     this.timestamp      = DateTime.Now;
 }