internal static MessageContext Enter(string returnAddress) { if (current != null) { #if DEBUG throw new InvalidOperationException( string.Format( @"Cannot establish new message context when one is already present! Stacktrace of when the current message context was created: {0}", current.StackTrace)); #else throw new InvalidOperationException( string.Format("Cannot establish new message context when one is already present")); #endif } current = new MessageContext { ReturnAddress = returnAddress }; Established(current); return current; }
internal static MessageContext Enter(IDictionary<string, string> headers) { if (current != null) { #if DEBUG throw new InvalidOperationException( string.Format( @"Cannot establish new message context when one is already present! Stacktrace of when the current message context was created: {0}", current.StackTrace)); #else throw new InvalidOperationException( string.Format("Cannot establish new message context when one is already present")); #endif } var messageContext = new MessageContext(headers); current = messageContext; Established(current); return messageContext; }
public void Dispose() { current = null; Disposed(); }
public void Dispose() { current = null; }
internal static MessageContext Establish(IDictionary<string, object> headers) { var messageContext = new MessageContext(headers); Establish(messageContext, overwrite: false); return messageContext; }