LicenseServices

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

Provides a way to register and obtain a list of services to support licensing. This class cannot be inherited.

public sealed class LicenseServices : ILicenseServiceProvider

Inheritance

objectLicenseServices

Implements

ILicenseServiceProvider

Inherited Members

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

Fields

Current

The LicenseServices singleton.

public static readonly LicenseServices Current

Field Value

LicenseServices

Properties

LicenseContext

Gets or sets a license context.

public ILicenseContext LicenseContext { get; set; }

Property Value

ILicenseContext

RegisteredServiceTypes

Gets the list of registered service types.

public IEnumerable<Type> RegisteredServiceTypes { get; }

Property Value

IEnumerable<Type>

Methods

AddService(Type, object)

Adds the specified service to the internal collection of services.

public void AddService(Type serviceType, object service)

Parameters

NameDescription

serviceType Type

The type of the service to add.

service object

The service object instance to add.

Exceptions

NameDescription

Thrown when one or more required arguments are null.

GetService(Type)

Gets type-based services from the license service provider.

public object GetService(Type serviceType)

Parameters

NameDescription

serviceType Type

An object that specifies the type of service object to get.

Returns

NameDescription

The requested service, or a null reference (Nothing in Visual Basic) if the service could not be located.

Remarks

The return value of GetService must be cast to the interface type.

GetService<T>()

Gets type-based services from the license service provider.

public T GetService<T>() where T : class

Returns

Type Parameters

NameDescription

T

The type of service object to get.

GetService(string)

Gets type-based services from the license service provider.

public object GetService(string serviceType)

Parameters

NameDescription

serviceType string

The full type name of service object to get.

Returns

NameDescription

The requested service, or a null reference (Nothing in Visual Basic) if the service could not be located

Remarks

The return value of GetService must be cast to the interface type.

Last updated