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.
Csla.Xaml.Shared/ApplicationContextManager.cs
Go to the documentation of this file.
1
//-----------------------------------------------------------------------
2
// <copyright file="ApplicationContextManager.cs" company="Marimer LLC">
3
// Copyright (c) Marimer LLC. All rights reserved.
4
// Website: https://cslanet.com
5
// </copyright>
6
// <summary>Provides consistent context information between the client</summary>
7
//-----------------------------------------------------------------------
8
using
System.Security.Principal;
9
using
System.Threading;
10
11
namespace
Csla.Xaml
12
{
16
public
class
ApplicationContextManager
:
Csla
.Core.
ApplicationContextManager
17
{
18
private
static
IPrincipal _principal =
null
;
19
24
public
override
IPrincipal
GetUser
()
25
{
26
if
(_principal ==
null
)
27
{
28
if
(ApplicationContext.AuthenticationType ==
"Windows"
)
29
#pragma warning disable CA1416
// Validate platform compatibility
30
SetUser
(
new
WindowsPrincipal(WindowsIdentity.GetCurrent()));
31
#pragma warning restore CA1416
// Validate platform compatibility
32
else
33
SetUser
(
new
System.Security.Claims.ClaimsPrincipal());
34
}
35
return
_principal;
36
}
37
42
public
override
void
SetUser
(IPrincipal principal)
43
{
44
_principal = principal;
45
Thread.CurrentPrincipal = principal;
46
}
47
}
48
}
Csla.Xaml.ApplicationContextManager
ApplicationContextManager for WPF applications
Definition:
Csla.Xaml.Shared/ApplicationContextManager.cs:17
Csla.Xaml.ApplicationContextManager.SetUser
override void SetUser(IPrincipal principal)
Sets the current principal.
Definition:
Csla.Xaml.Shared/ApplicationContextManager.cs:42
Csla.Xaml.ApplicationContextManager.GetUser
override IPrincipal GetUser()
Gets the current principal.
Definition:
Csla.Xaml.Shared/ApplicationContextManager.cs:24
Csla.Xaml
Definition:
Csla.Xaml.Shared/ApplicationContextManager.cs:12
Csla
Definition:
Csla.AspNetCore.Shared/ApplicationContextManager.cs:16
Generated by
1.9.2