예제 #1
0
 /// <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;
 }
예제 #2
0
 /// <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;
 }
예제 #3
0
 /// <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;
 }
예제 #4
0
 /// <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();
       }
 }
예제 #5
0
    /// <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();
      }
    }
예제 #6
0
 public void SetLocalContext(ContextDictionary localContext)
 {
     LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_localContextName);
     Thread.SetData(slot, localContext);
 }
예제 #7
0
 /// <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;
 }
예제 #9
0
 /// <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;
 }
예제 #10
0
 public void SetLocalContext(ContextDictionary localContext)
 {
   _localContext = localContext;
 }
예제 #11
0
 /// <summary>
 /// Sets the client context.
 /// </summary>
 /// <param name="clientContext">Client context.</param>
 public void SetClientContext(ContextDictionary clientContext)
 {
     HttpContext.Current.Items[_clientContextName] = clientContext;
 }
예제 #12
0
 /// <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();
 }
예제 #13
0
 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");
 }
예제 #14
0
 /// <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;
 }
예제 #18
0
 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);
     }
 }
예제 #19
0
 /// <summary>
 /// Sets the global context.
 /// </summary>
 /// <param name="globalContext">Global context.</param>
 public void SetGlobalContext(ContextDictionary globalContext)
 {
     HttpContext.Current.Items[_globalContextName] = globalContext;
 }
예제 #20
0
 /// <summary>
 /// Creates an instance of the object.
 /// </summary>
 public DataPortalResult()
 {
   GlobalContext = ApplicationContext.ContextManager.GetGlobalContext();
 }
예제 #21
0
 public void SetGlobalContext(ContextDictionary globalContext)
 {
   _globalContext = globalContext;
 }
예제 #22
0
 /// <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;
 }
예제 #23
0
파일: TestContext.cs 프로젝트: Jaans/csla
 public void SetGlobalContext(ContextDictionary globalContext)
 {
     _myContext[_globalContextName] = globalContext;
 }
예제 #24
0
 internal static void SetContext(
   ContextDictionary clientContext,
   ContextDictionary globalContext)
 {
   lock (_syncContext)
     ContextManager.SetClientContext(clientContext);
   ContextManager.SetGlobalContext(globalContext);
 }
예제 #25
0
 /// <summary>
 /// Sets the local context dictionary.
 /// </summary>
 /// <param name="localContext">Context dictionary</param>
 public void SetLocalContext(ContextDictionary localContext)
 {
     currentLocalContext = localContext;
 }
예제 #26
0
 public void SetClientContext(ContextDictionary clientContext)
 {
   _clientContext = clientContext;
 }
예제 #27
0
 /// <summary>
 /// Sets the client context dictionary.
 /// </summary>
 /// <param name="clientContext">Context dictionary</param>
 public void SetClientContext(ContextDictionary clientContext)
 {
     currentClientContext = clientContext;
 }
예제 #28
0
파일: TestContext.cs 프로젝트: Jaans/csla
 public void SetClientContext(ContextDictionary clientContext)
 {
     _myContext[_clientContextName] = clientContext;
 }
 public void SetGlobalContext(ContextDictionary globalContext)
 {
     _myContext[UniqueIdentifier][_globalContextName] = globalContext;
 }
예제 #30
0
파일: TestContext.cs 프로젝트: Jaans/csla
 public void SetLocalContext(ContextDictionary localContext)
 {
     _myContext[_localContextName] = localContext;
 }
 public void SetLocalContext(ContextDictionary localContext)
 {
     _myContext[UniqueIdentifier][_localContextName] = localContext;
 }