RegistryLicenseProvider

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

Represents an license provider used to manage licenses stored in the Windows registry.

public class RegistryLicenseProvider : BabelLicenseProvider, ILicenseProvider

Inheritance

objectLicenseProviderBabelLicenseProviderRegistryLicenseProvider

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

RegistryLicenseProvider()

Initializes a new instance of the class.

public RegistryLicenseProvider()

Properties

LicenseFactory

Gets or sets the license factory

public ILicenseFactory LicenseFactory { get; set; }

Property Value

ILicenseFactory

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

A

An object that is requesting the license.

Returns

NameDescription

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

GetRegistryKey(Type, object)

Gets the license string stored into the registry key associated with the given type and object instance. If not overridden, the license string is retrieved from the registry key built using the information stored within the and attributes for the given type according the following rule: HKEY_CURRENT_USER\SOFTWARE\AssemblyCompanyAttribute\AssemblyProductAttribute\LicenseKey

protected virtual string GetRegistryKey(Type type, object instance)

Parameters

NameDescription

A that represents the component requesting the license.

An object that is requesting the license.

Returns

NameDescription

The license registry key.

ValidateLicenseKey(string, ILicenseContext, Type, object)

Validates the license key.

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

Parameters

NameDescription

The license key.

A

A

An object that is requesting the license.

Returns

NameDescription

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

Last updated