BabelFileLicenseProvider
Namespace: Babel.Licensing Assembly: Babel.Licensing.dll
Represents an license provider used to manage licenses stored in a file on disk. This class cannot be inherited.
public class BabelFileLicenseProvider : IAsyncLicenseProvider, ILicenseProviderInheritance
object ← BabelFileLicenseProvider
Implements
IAsyncLicenseProvider, ILicenseProvider
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
BabelFileLicenseProvider()
Initializes a new instance of the class.
public BabelFileLicenseProvider()BabelFileLicenseProvider(ILicenseFactory)
Initializes a new instance of the class.
public BabelFileLicenseProvider(ILicenseFactory factory)Parameters
factory ILicenseFactory
The license factory.
Exceptions
Thrown when one or more required arguments are null.
Properties
EnvironmentVariable
Gets or sets the environment variable name that contains the license file path.
public string EnvironmentVariable { get; set; }Property Value
LicenseFactory
Gets or sets the .
public ILicenseFactory LicenseFactory { get; set; }Property Value
LicenseFilePath
Gets or sets the license file full path.
public string LicenseFilePath { get; set; }Property Value
LicenseFileSearchDirectories
Gets or sets the directories where to search for a license file.
public string[] LicenseFileSearchDirectories { get; set; }Property Value
string[]
ReadRetryCount
Gets or sets the number of times to retry reading the license file.
public int ReadRetryCount { get; set; }Property Value
ReadRetryDelay
Gets or sets the delay in milliseconds between each retry.
public int ReadRetryDelay { get; set; }Property Value
SignatureProvider
Gets or sets the signature provider
public ISignatureProvider SignatureProvider { get; set; }Property Value
Methods
GetLicense(ILicenseContext, Type, object)
When overridden in a derived class, gets a license for an instance or type of component, when given a context and whether the denial of a license throws an exception.
public virtual ILicense GetLicense(ILicenseContext context, Type type, object instance)Parameters
Returns
A valid .
GetLicenseAsync(ILicenseContext, Type, object, CancellationToken)
Gets a license for the specified context, type, and instance asynchronously.
public Task<ILicense> GetLicenseAsync(ILicenseContext context, Type type, object instance, CancellationToken cancellationToken = default)Parameters
context ILicenseContext
The license context.
type Type
The type requesting the license.
instance object
The instance requesting the license.
cancellationToken CancellationToken
The cancellation token.
Returns
OnLicenseFileFound(LicenseFileFoundEventArgs)
Raises the license file found event.
protected virtual void OnLicenseFileFound(LicenseFileFoundEventArgs args)Parameters
Event information to send to registered event handlers.
ValidateLicenseKey(string, ILicenseContext, Type, object)
Validates the license key.
protected virtual ILicense ValidateLicenseKey(string licenseKey, ILicenseContext context, Type type, object instance)Parameters
licenseKey string
The license key.
context ILicenseContext
A
type Type
A
instance object
An object that is requesting the license.
Returns
A valid object.
LicenseFileFound
Event queue for all listeners interested in LicenseFileFound events.
public event EventHandler<LicenseFileFoundEventArgs> LicenseFileFoundEvent Type
Last updated