/// <summary> /// Creates a new DataPortalContext object. /// </summary> /// <param name="principal">The current Principal object.</param> /// <param name="isRemotePortal">Indicates whether the DataPortal is remote.</param> /// <param name="clientContext">Client context.</param> /// <param name="clientCulture">Client culture.</param> /// <param name="clientUICulture">Client UI culture.</param> /// <param name="globalContext">Global context.</param> public DataPortalContext(IPrincipal principal, bool isRemotePortal, string clientCulture, string clientUICulture, ContextDictionary clientContext, ContextDictionary globalContext) { _principal = principal; _clientContext = clientContext; _clientCulture = clientCulture; _clientUICulture = clientUICulture; _globalContext = globalContext; _remotePortal = isRemotePortal; }
/// <summary> /// New instance of criteria object /// </summary> /// <param name="objectToUpdate">Business object that will be updated.</param> /// <param name="principal">Principal that will be set for the request</param> /// <param name="globalContext">Global context object.</param> /// <param name="clientContext">Client context object.</param> /// <param name="clientCulture">The client culture.</param> /// <param name="clientUICulture">The client UI culture.</param> public MobileUpdateRequest( object objectToUpdate, IPrincipal principal, ContextDictionary globalContext, ContextDictionary clientContext, string clientCulture, string clientUICulture) { ObjectToUpdate = objectToUpdate; Principal = principal; GlobalContext = globalContext; ClientContext = clientContext; ClientCulture = clientCulture; ClientUICulture = clientUICulture; }
/// <summary> /// New instance of criteria object /// </summary> /// <param name="typeName">Type of object that is the target of the request</param> /// <param name="criteria">Criteria object.</param> /// <param name="principal">Principal that will be set for the request</param> /// <param name="globalContext">Global context object.</param> /// <param name="clientContext">Client context object.</param> /// <param name="clientCulture">The client culture.</param> /// <param name="clientUICulture">The client UI culture.</param> public MobileCriteriaRequest( string typeName, object criteria, IPrincipal principal, ContextDictionary globalContext, ContextDictionary clientContext, string clientCulture, string clientUICulture) { TypeName = typeName; Criteria = criteria; Principal = principal; GlobalContext = globalContext; ClientContext = clientContext; ClientCulture = clientCulture; ClientUICulture = clientUICulture; }
/// <summary> /// Creates a new DataPortalContext object. /// </summary> /// <param name="principal">The current Principal object.</param> /// <param name="isRemotePortal">Indicates whether the DataPortal is remote.</param> public DataPortalContext(IPrincipal principal, bool isRemotePortal) { if (isRemotePortal) { _principal = principal; _remotePortal = isRemotePortal; #if NETFX_CORE _clientCulture = System.Globalization.CultureInfo.CurrentCulture.Name; _clientUICulture = System.Globalization.CultureInfo.CurrentUICulture.Name; #else _clientCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; _clientUICulture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name; #endif _clientContext = Csla.ApplicationContext.ContextManager.GetClientContext(); _globalContext = Csla.ApplicationContext.ContextManager.GetGlobalContext(); } }
/// <summary> /// Creates a new DataPortalContext object. /// </summary> /// <param name="principal">The current Principal object.</param> /// <param name="isRemotePortal">Indicates whether the DataPortal is remote.</param> public DataPortalContext(IPrincipal principal, bool isRemotePortal) { if (isRemotePortal) { _principal = principal; _remotePortal = isRemotePortal; #if NETFX_CORE var language = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().Languages[0]; _clientCulture = language; _clientUICulture = language; #else _clientCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; _clientUICulture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name; #endif _clientContext = Csla.ApplicationContext.ContextManager.GetClientContext(); _globalContext = Csla.ApplicationContext.ContextManager.GetGlobalContext(); } }
public void SetLocalContext(ContextDictionary localContext) { LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_localContextName); Thread.SetData(slot, localContext); }
/// <summary> /// Sets the global context dictionary. /// </summary> /// <param name="globalContext">Context dictionary</param> public void SetGlobalContext(ContextDictionary globalContext) { currentGlobalContext = globalContext; }
public void SetClientContext(ContextDictionary clientContext) { _myContext[UniqueIdentifier][_clientContextName] = clientContext; }
/// <summary> /// Creates an instance of the object. /// </summary> /// <param name="returnObject">Object to return as part /// of the result.</param> /// <param name="ex"> /// Error that occurred during the DataPotal call. /// This will be null if no errors occurred. /// </param> /// <param name="globalContext"> Global context delivered via current reuest from the server /// </param> public DataPortalResult(object returnObject, Exception ex, ContextDictionary globalContext) { ReturnObject = returnObject; Error = ex; GlobalContext = globalContext; }
public void SetLocalContext(ContextDictionary localContext) { _localContext = localContext; }
/// <summary> /// Sets the client context. /// </summary> /// <param name="clientContext">Client context.</param> public void SetClientContext(ContextDictionary clientContext) { HttpContext.Current.Items[_clientContextName] = clientContext; }
/// <summary> /// Creates an instance of the object. /// </summary> /// <param name="returnObject">Object to return as part /// of the result.</param> public DataPortalResult(object returnObject) { ReturnObject = returnObject; GlobalContext = ApplicationContext.ContextManager.GetGlobalContext(); }
void Serialization.Mobile.IMobileObject.SetState(Serialization.Mobile.SerializationInfo info) { _principal = (IPrincipal)Csla.Serialization.Mobile.MobileFormatter.Deserialize(info.GetValue<byte[]>("principal")); _clientContext = (ContextDictionary)Csla.Serialization.Mobile.MobileFormatter.Deserialize(info.GetValue<byte[]>("clientContext")); _clientCulture = info.GetValue<string>("clientCulture"); _clientUICulture = info.GetValue<string>("clientUICulture"); _globalContext = (ContextDictionary)Csla.Serialization.Mobile.MobileFormatter.Deserialize(info.GetValue<byte[]>("globalContext")); ; _remotePortal = info.GetValue<bool>("isRemotePortal"); }
/// <summary> /// Sets the local context. /// </summary> /// <param name="localContext">Local context.</param> public void SetLocalContext(ContextDictionary localContext) { HttpContext.Current.Items[_localContextName] = localContext; }
/// <summary> /// Sets the local context dictionary. /// </summary> /// <param name="localContext">Context dictionary</param> public void SetLocalContext(ContextDictionary localContext) { LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_localContextName); Thread.SetData(slot, localContext); }
/// <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) { _clientContext.Value = clientContext; }
/// <summary> /// Sets the local context dictionary. /// </summary> /// <param name="localContext">Context dictionary</param> public void SetLocalContext(ContextDictionary localContext) { _localContext.Value = localContext; }
public void SetClientContext(ContextDictionary clientContext) { if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) { AppDomain.CurrentDomain.SetData(_clientContextName, clientContext); } else { LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_clientContextName); Thread.SetData(slot, clientContext); } }
/// <summary> /// Sets the global context. /// </summary> /// <param name="globalContext">Global context.</param> public void SetGlobalContext(ContextDictionary globalContext) { HttpContext.Current.Items[_globalContextName] = globalContext; }
/// <summary> /// Creates an instance of the object. /// </summary> public DataPortalResult() { GlobalContext = ApplicationContext.ContextManager.GetGlobalContext(); }
public void SetGlobalContext(ContextDictionary globalContext) { _globalContext = globalContext; }
/// <summary> /// Creates an instance of the object. /// </summary> /// <param name="returnObject">Object to return as part /// of the result.</param> /// <param name="globalContext"> Global context delivered via current reuest from the server /// </param> public DataPortalResult(object returnObject, ContextDictionary globalContext) { ReturnObject = returnObject; GlobalContext = globalContext; }
public void SetGlobalContext(ContextDictionary globalContext) { _myContext[_globalContextName] = globalContext; }
internal static void SetContext( ContextDictionary clientContext, ContextDictionary globalContext) { lock (_syncContext) ContextManager.SetClientContext(clientContext); ContextManager.SetGlobalContext(globalContext); }
/// <summary> /// Sets the local context dictionary. /// </summary> /// <param name="localContext">Context dictionary</param> public void SetLocalContext(ContextDictionary localContext) { currentLocalContext = localContext; }
public void SetClientContext(ContextDictionary clientContext) { _clientContext = clientContext; }
/// <summary> /// Sets the client context dictionary. /// </summary> /// <param name="clientContext">Context dictionary</param> public void SetClientContext(ContextDictionary clientContext) { currentClientContext = clientContext; }
public void SetClientContext(ContextDictionary clientContext) { _myContext[_clientContextName] = clientContext; }
public void SetGlobalContext(ContextDictionary globalContext) { _myContext[UniqueIdentifier][_globalContextName] = globalContext; }
public void SetLocalContext(ContextDictionary localContext) { _myContext[_localContextName] = localContext; }
public void SetLocalContext(ContextDictionary localContext) { _myContext[UniqueIdentifier][_localContextName] = localContext; }