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(); }
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(); } } }
internal MessageLogTraceRecord(string message, System.ServiceModel.Diagnostics.MessageLoggingSource source) : this(source) { this.type = null; this.messageString = message; }
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); }
private MessageLogTraceRecord(System.ServiceModel.Diagnostics.MessageLoggingSource source) { this.logMessageBody = true; this.source = source; this.timestamp = DateTime.Now; }