コード例 #1
0
ファイル: DataPortalContext.cs プロジェクト: RodrigoGT/csla
 /// <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
ファイル: DataPortalContext.cs プロジェクト: RodrigoGT/csla
 /// <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
ファイル: DataPortalContext.cs プロジェクト: jaamarcelis/csla
    /// <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;
 }
コード例 #8
0
 public void SetClientContext(ContextDictionary clientContext)
 {
     _myContext[UniqueIdentifier][_clientContextName] = clientContext;
 }
コード例 #9
0
ファイル: DataPortalResult.cs プロジェクト: BiYiTuan/csla
 /// <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
ファイル: DataPortalResult.cs プロジェクト: BiYiTuan/csla
 /// <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
ファイル: DataPortalContext.cs プロジェクト: BiYiTuan/csla
 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;
 }
コード例 #15
0
        /// <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);
        }
コード例 #16
0
 /// <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;
 }
コード例 #17
0
 /// <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
ファイル: DataPortalResult.cs プロジェクト: BiYiTuan/csla
 /// <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
ファイル: DataPortalResult.cs プロジェクト: BiYiTuan/csla
 /// <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;
 }
コード例 #29
0
 public void SetGlobalContext(ContextDictionary globalContext)
 {
     _myContext[UniqueIdentifier][_globalContextName] = globalContext;
 }
コード例 #30
0
ファイル: TestContext.cs プロジェクト: Jaans/csla
 public void SetLocalContext(ContextDictionary localContext)
 {
     _myContext[_localContextName] = localContext;
 }
コード例 #31
0
 public void SetLocalContext(ContextDictionary localContext)
 {
     _myContext[UniqueIdentifier][_localContextName] = localContext;
 }