BabelLicenseContext

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

An abstract base class for license context.

public abstract class BabelLicenseContext : ILicenseContext, ILicenseServiceProvider

Inheritance

objectBabelLicenseContext

Implements

ILicenseContext, ILicenseServiceProvider

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

BabelLicenseContext()

Default constructor.

public BabelLicenseContext()

Properties

ContextName

Gets the name of the context.

public abstract string ContextName { get; }

Property Value

string

FallbackContext

Gets or sets a fallback license context. The fallback context will be used in search for license services when the required service is not found in the present context.

public ILicenseContext FallbackContext { get; set; }

Property Value

ILicenseContext

Settings

Gets or sets license context options.

public ContextSettings Settings { get; set; }

Property Value

ContextSettings

Methods

ClearLicenseKeys()

Clear stored license keys.

public void ClearLicenseKeys()

GetService(Type)

Provides a license service for the given type.

public virtual object GetService(Type serviceType)

Parameters

NameDescription

serviceType Type

Type of the service.

Returns

NameDescription

The service.

IsContextValid(Type)

Query if a context is valid for the given type. If the context is not valid the license will be reloaded inside the context.

protected virtual bool IsContextValid(Type type)

Parameters

NameDescription

type Type

The type.

Returns

NameDescription

true if the context is valid, false if not.

LoadLicenseKey(Type)

Loads license key.

public virtual string LoadLicenseKey(Type type)

Parameters

NameDescription

type Type

The type.

Returns

NameDescription

The license key.

Exceptions

NameDescription

Thrown when one or more required arguments are null.

SaveLicenseKey(Type, string)

Saves a license key.

public virtual void SaveLicenseKey(Type type, string key)

Parameters

NameDescription

type Type

The type.

key string

The key.

Exceptions

NameDescription

Thrown when one or more required arguments are null.

Last updated