FileLicenseProvider

Namespace: Babel.Licensing Assembly: Babel.Licensing.dll

Represents an license provider used to manage licenses stored in a file on disk.

public class FileLicenseProvider : BabelLicenseProvider, ILicenseProvider

Inheritance

objectLicenseProviderBabelLicenseProviderFileLicenseProvider

Implements

ILicenseProvider

Inherited Members

BabelLicenseProvider.GetLicense(ILicenseContext, Type, object), BabelLicenseProvider.GetLicense(LicenseContext, Type, object, bool), LicenseProvider.GetLicense(LicenseContext, Type, object?, bool), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

FileLicenseProvider()

Initializes a new instance of the class.

public FileLicenseProvider()

FileLicenseProvider(ILicenseFactory)

Initializes a new instance of the class.

public FileLicenseProvider(ILicenseFactory factory)

Parameters

NameDescription

The license factory.

Exceptions

NameDescription

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 static string EnvironmentVariable { get; set; }

Property Value

string

LicenseFactory

Gets or sets the .

public ILicenseFactory LicenseFactory { get; set; }

Property Value

ILicenseFactory

LicenseFile

Gets or sets the license file full path.

public static string LicenseFile { get; set; }

Property Value

string

SearchDirectories

Gets or sets the directories where to search for a license file.

public static string[] SearchDirectories { get; set; }

Property Value

string[]

SignatureProvider

Gets or sets the signature provider

public ISignatureProvider SignatureProvider { get; set; }

Property Value

ISignatureProvider

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 override ILicense GetLicense(ILicenseContext context, Type type, object instance)

Parameters

NameDescription

A

type Type

A

instance object

An object that is requesting the license.

Returns

NameDescription

A valid for the specified context, type, and instance.

ValidateLicenseKey(string, ILicenseContext, Type, object)

Validates the license key.

protected virtual ILicense ValidateLicenseKey(string licenseKey, ILicenseContext context, Type type, object instance)

Parameters

NameDescription

licenseKey string

The license key.

A

type Type

A

instance object

An object that is requesting the license.

Returns

NameDescription

A valid object.

Last updated