public override Message CreateMessage () { if (closed) throw new ObjectDisposedException ("The message buffer has already been closed."); Message msg; if (body == null) msg = new EmptyMessage (headers.MessageVersion, headers.Action); else msg = new SimpleMessage (headers.MessageVersion, headers.Action, body.CreateBufferedCopy (max_buffer_size), is_fault); msg.Headers.Clear (); msg.Headers.CopyHeadersFrom (headers); msg.Properties.CopyProperties (properties); return msg; }
public override Message CreateMessage() { if (closed) { throw new ObjectDisposedException("The message buffer has already been closed."); } Message msg; if (body == null) { msg = new EmptyMessage(headers.MessageVersion, headers.Action); } else { msg = new SimpleMessage(headers.MessageVersion, headers.Action, body.CreateBufferedCopy(max_buffer_size), is_fault, attributes); } msg.Headers.Clear(); msg.Headers.CopyHeadersFrom(headers); msg.Properties.CopyProperties(properties); return(msg); }