Table of Contents

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

licenseOptions IOptionsMonitor<LicenseOptions>

The license options.

hostEnvironment IHostEnvironment

The host environment.

loggerFactory ILoggerFactory

The 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

true if the license has expired; otherwise false.

IsLicenseProvided()

Indicates whether a license is provided.

public bool IsLicenseProvided()

Returns

bool

true if a license is provided; otherwise false.

IsLicensed()

Indicates whether the product is licensed.

public bool IsLicensed()

Returns

bool

true if licensed; otherwise false.

LoadLicenseAsync()

Loads the license.

public Task LoadLicenseAsync()

Returns

Task

A task that represents the operation.

Exceptions

InvalidLicenseException

Thrown when the license fails to load.