public ContextDictionary GetClientContext(ApplicationContext.ExecutionLocations executionLocation) { if (_myContext[_clientContextName] == null) { SetClientContext(new ContextDictionary(), executionLocation); } return((ContextDictionary)_myContext[_clientContextName]); }
/// <summary> /// Gets the client context dictionary. /// </summary> /// <param name="executionLocation"></param> public ContextDictionary GetClientContext(ApplicationContext.ExecutionLocations executionLocation) { if (executionLocation == ApplicationContext.ExecutionLocations.Client) { return((ContextDictionary)AppDomain.CurrentDomain.GetData(_clientContextName)); } else { LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_clientContextName); return((ContextDictionary)Thread.GetData(slot)); } }
/// <summary> /// Sets the client context dictionary. /// </summary> /// <param name="clientContext">Context dictionary</param> /// <param name="executionLocation"></param> public void SetClientContext(ContextDictionary clientContext, ApplicationContext.ExecutionLocations executionLocation) { if (executionLocation == ApplicationContext.ExecutionLocations.Client) { AppDomain.CurrentDomain.SetData(_clientContextName, clientContext); } else { LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_clientContextName); Thread.SetData(slot, clientContext); } }
/// <summary> /// Sets the client context. /// </summary> /// <param name="clientContext">Client context.</param> /// <param name="executionLocation"></param> public void SetClientContext(ContextDictionary clientContext, ApplicationContext.ExecutionLocations executionLocation) { HttpContext.Current.Items[_clientContextName] = clientContext; }
/// <summary> /// Gets the client context. /// </summary> /// <param name="executionLocation"></param> public ContextDictionary GetClientContext(ApplicationContext.ExecutionLocations executionLocation) { return((ContextDictionary)HttpContext.Current.Items[_clientContextName]); }
public void SetClientContext(ContextDictionary clientContext, ApplicationContext.ExecutionLocations executionLocation) { _myContext[_clientContextName] = clientContext; }
/// <summary> /// Sets the client context dictionary. /// </summary> /// <param name="clientContext">Context dictionary</param> /// <param name="executionLocation"></param> public void SetClientContext(ContextDictionary clientContext, ApplicationContext.ExecutionLocations executionLocation) { currentClientContext = clientContext; }
/// <summary> /// Gets the client context dictionary. /// </summary> /// <param name="executionLocation"></param> public ContextDictionary GetClientContext(ApplicationContext.ExecutionLocations executionLocation) { return(currentClientContext); }
/// <summary> /// Gets the client context dictionary. /// </summary> /// <param name="executionLocation"></param> public ContextDictionary GetClientContext(ApplicationContext.ExecutionLocations executionLocation) { return(_clientContext.Value); }