CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
ContextParams.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ContextParams.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Implementation of a lock that waits while</summary>
7//----------------------------------------------------------------------
8using System.Globalization;
9using System.Security.Principal;
10using System.Threading;
11using Csla.Core;
12
13namespace Csla.Threading
14{
18 internal class ContextParams
19 {
20 public IPrincipal User { get; private set; }
21 public Csla.Core.ContextDictionary ClientContext { get; private set; }
22 public Csla.Core.ContextDictionary GlobalContext { get; private set; }
23 public CultureInfo UICulture { get; private set; }
24 public CultureInfo Culture { get; private set; }
25
26 public ContextParams()
27 {
28 this.User = Csla.ApplicationContext.User;
29 this.ClientContext = Csla.ApplicationContext.ClientContext;
30#pragma warning disable CS0618 // Type or member is obsolete
31 this.GlobalContext = Csla.ApplicationContext.GlobalContext;
32#pragma warning restore CS0618 // Type or member is obsolete
33 this.Culture = System.Globalization.CultureInfo.CurrentCulture;
34 this.UICulture = System.Globalization.CultureInfo.CurrentUICulture;
35 }
36
37 internal void SetThreadContext()
38 {
39 Csla.ApplicationContext.User = User;
40 Csla.ApplicationContext.SetContext(ClientContext, GlobalContext);
41 Thread.CurrentThread.CurrentUICulture = UICulture;
42 Thread.CurrentThread.CurrentCulture = Culture;
43 }
44 }
45}
Dictionary type that is serializable with the SerializationFormatterFactory.GetFormatter().