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.Windows.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;
9
using
System.Security.Principal;
10
using
System.Threading;
11
using
Csla
.
Core
;
12
13
namespace
Csla.Windows
14
{
18
public
class
ApplicationContextManager
:
Csla
.Core.
ApplicationContextManager
19
{
20
private
static
IPrincipal _principal;
21
26
public
override
IPrincipal
GetUser
()
27
{
28
if
(_principal ==
null
)
29
{
30
if
(ApplicationContext.AuthenticationType !=
"Windows"
)
31
SetUser
(
new
System.Security.Claims.ClaimsPrincipal());
32
else
33
#pragma warning disable CA1416
// Validate platform compatibility
34
SetUser
(
new
WindowsPrincipal(WindowsIdentity.GetCurrent()));
35
#pragma warning restore CA1416
// Validate platform compatibility
36
}
37
return
_principal;
38
}
39
44
public
override
void
SetUser
(IPrincipal principal)
45
{
46
_principal = principal;
47
Thread.CurrentPrincipal = principal;
48
}
49
}
50
}
Csla.Windows.ApplicationContextManager
ApplicationContextManager for Windows Forms applications
Definition:
Csla.Windows.Shared/ApplicationContextManager.cs:19
Csla.Windows.ApplicationContextManager.GetUser
override IPrincipal GetUser()
Gets the current principal.
Definition:
Csla.Windows.Shared/ApplicationContextManager.cs:26
Csla.Windows.ApplicationContextManager.SetUser
override void SetUser(IPrincipal principal)
Sets the current principal.
Definition:
Csla.Windows.Shared/ApplicationContextManager.cs:44
Csla.Core
Definition:
AddedNewEventArgs.cs:11
Csla.Windows
Definition:
Csla.Windows.Shared/ApplicationContextManager.cs:14
Csla
Definition:
Csla.AspNetCore.Shared/ApplicationContextManager.cs:16
Generated by
1.9.2