Class LicenseManager
- Namespace
- ComponentSpace.Saml2.Licensing
- Assembly
- ComponentSpace.Saml2.dll
The license manager.
public class LicenseManager
- Inheritance
-
LicenseManager
- Inherited Members
Constructors
LicenseManager(IOptionsMonitor<LicenseOptions>, IHostEnvironment, ILoggerFactory)
Initializes a new instance of the LicenseManager class.
public LicenseManager(IOptionsMonitor<LicenseOptions> licenseOptions, IHostEnvironment hostEnvironment, ILoggerFactory loggerFactory)
Parameters
licenseOptionsIOptionsMonitor<LicenseOptions>The license options.
hostEnvironmentIHostEnvironmentThe host environment.
loggerFactoryILoggerFactoryThe logger factory.
Properties
CustomerID
Gets the customer ID.
public string CustomerID { get; }
Property Value
- string
The customer ID.
Expiry
Gets the expiry date.
public DateTime Expiry { get; }
Property Value
- DateTime
The expiry date.
IssuedAt
Gets the issued at date.
public DateTime IssuedAt { get; }
Property Value
- DateTime
The issued at date.
LicenseNumber
Gets the license number.
public string LicenseNumber { get; }
Property Value
- string
The license number.
ProductID
Gets the product ID.
public string ProductID { get; }
Property Value
- string
The product ID.
Methods
CheckLicense()
Checks for a valid license.
public void CheckLicense()
Exceptions
- InvalidLicenseException
Thrown when the license check fails.
HasExpired()
Indicates whether the license has expired.
public bool HasExpired()
Returns
- bool
trueif the license has expired; otherwisefalse.
IsLicenseProvided()
Indicates whether a license is provided.
public bool IsLicenseProvided()
Returns
- bool
trueif a license is provided; otherwisefalse.
IsLicensed()
Indicates whether the product is licensed.
public bool IsLicensed()
Returns
- bool
trueif licensed; otherwisefalse.
LoadLicenseAsync()
Loads the license.
public Task LoadLicenseAsync()
Returns
- Task
A task that represents the operation.
Exceptions
- InvalidLicenseException
Thrown when the license fails to load.