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
Implements
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
Properties
LicenseContext
Gets or sets a license context.
public ILicenseContext LicenseContext { get; set; }
Property Value
RegisteredServiceTypes
Gets the list of registered service types.
public IEnumerable<Type> RegisteredServiceTypes { get; }
Property Value
Methods
AddService(Type, object)
Adds the specified service to the internal collection of services.
public void AddService(Type serviceType, object service)
Parameters
Exceptions
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
serviceType
Type
An object that specifies the type of service object to get.
Returns
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
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
serviceType
string
The full type name of service object to get.
Returns
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