internal static HostExecutionContext CaptureHostExecutionContext() { HostExecutionContext context = null; HostExecutionContextManager currentHostExecutionContextManager = GetCurrentHostExecutionContextManager(); if (currentHostExecutionContextManager != null) { context = currentHostExecutionContextManager.Capture(); } return(context); }
internal static HostExecutionContext CaptureHostExecutionContext() { HostExecutionContext executionContext = (HostExecutionContext)null; HostExecutionContextManager executionContextManager = HostExecutionContextManager.GetCurrentHostExecutionContextManager(); if (executionContextManager != null) { executionContext = executionContextManager.Capture(); } return(executionContext); }
internal static HostExecutionContext CaptureHostExecutionContext() { HostExecutionContext result = null; HostExecutionContextManager currentHostExecutionContextManager = HostExecutionContextManager.GetCurrentHostExecutionContextManager(); if (currentHostExecutionContextManager != null) { result = currentHostExecutionContextManager.Capture(); } return(result); }
internal static HostExecutionContext CaptureHostExecutionContext() { HostExecutionContext hostContext = null; // capture the host execution context HostExecutionContextManager hostMgr = HostExecutionContextManager.GetCurrentHostExecutionContextManager(); if (hostMgr != null) { hostContext = hostMgr.Capture(); } return(hostContext); }
public void Fiddeling_With_HostExecutionContextManager() { // http://stackoverflow.com/questions/6939037/log4net-logicalthreadcontext-not-working // https://issues.apache.org/jira/browse/LOG4NET-317 // http://logging.markmail.org/thread/q3bogptirf32g77r#query:+page:1+mid:tpgfykgizkpb2mxs+state:results // http://blogs.msdn.com/b/ericlippert/archive/2007/12/04/immutability-in-c-part-two-a-simple-immutable-stack.aspx var manager = new HostExecutionContextManager(); _context.Set("Item", "whatever"); var context = manager.Capture(); }