PISystems Constructor (ClaimsIdentity, Boolean)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Initializes a new instance of the PISystems collection with
for the ClaimsIdentity user with an option to create an
independent cache.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public PISystems( ClaimsIdentity claimsIdentity, bool forceNewInstance = false )
Public Sub New ( claimsIdentity As ClaimsIdentity, Optional forceNewInstance As Boolean = false ) Dim claimsIdentity As ClaimsIdentity Dim forceNewInstance As Boolean Dim instance As New PISystems(claimsIdentity, forceNewInstance)
public: PISystems( ClaimsIdentity^ claimsIdentity, bool forceNewInstance = false )
new : claimsIdentity : ClaimsIdentity * ?forceNewInstance : bool (* Defaults: let _forceNewInstance = defaultArg forceNewInstance false *) -> PISystems
Parameters
- claimsIdentity
- Type: System.Security.ClaimsClaimsIdentity
Identity to use when initializing instance. - forceNewInstance (Optional)
- Type: SystemBoolean
Set to to force the creation of an independent collection of PISystems for the current user with a separate cache.
Examples
ClaimsIdentity testAccountIdentity = new ClaimsIdentity(); testAccountIdentity = new ClaimsIdentity(); testAccountIdentity.AddClaim(new Claim("id", TestAccountName)); testAccountIdentity.AddClaim(new Claim("access_token", TestAccountAccessToken)); PISystems myPISystems = new PISystems(testAccountIdentity); PISystem piSystem = myPISystems.DefaultPISystem; piSystem.Connect(); Console.WriteLine("CurrentUserName = {0}", piSystem.CurrentUserName); Console.WriteLine("AuthenticationType = {0}", piSystem.ConnectionInfo.AuthenticationType); Console.WriteLine(); piSystem = myPISystems[AFServerMachine2]; piSystem.Connect(); Console.WriteLine("CurrentUserName = {0}", piSystem.CurrentUserName); Console.WriteLine("AuthenticationType = {0}", piSystem.ConnectionInfo.AuthenticationType); Console.WriteLine();