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