BabelLicenseManager
Namespace: Babel.Licensing Assembly: Babel.Licensing.dll
Provides properties and methods to manage a ILicenseProvider. This class cannot be inherited.
Inheritance
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
BabelLicenseManager()
Properties
CurrentContext
Gets the current , which specifies when you can use the licensed object.
Property Value
Methods
GetLicenseProvider(Type)
Gets a registered license provider of a given type.
Parameters
A
Returns
The license provider instance.
IsLicensed(Type)
Returns whether the given type has a valid license.
Parameters
The to find a valid license for.
Returns
true if the given type is licensed; otherwise, false.
Examples
IsLicensedAsync(Type, CancellationToken)
Async method that returns whether the given type has a valid license.
Parameters
The to find a valid license for.
(Optional) A token that allows processing to be cancelled.
Returns
true if the given type is licensed; otherwise, false.
IsValid(Type)
Determines whether a valid license can be granted for the specified type.
Parameters
A that represents the type of object that requests the license.
Returns
true if a valid license can be granted; otherwise, false.
IsValid(Type, object, out ILicense)
Determines whether a valid license can be granted for the specified instance of the type. This method creates a valid License.
Parameters
A that represents the type of object that requests the license.
An object of the specified type or a type derived from the specified type.
A that is a valid license, or null if a valid license cannot be granted.
Returns
true if a valid license can be granted; otherwise, false.
RegisterLicenseProvider(Type, ILicenseProvider)
Registers the license provider.
Parameters
A
The license provider instance.
Examples
Validate(Type)
Determines whether a license can be granted for the specified type.
Parameters
A that represents the type of object that requests the license.
Examples
Exceptions
A License cannot be granted.
Validate(Type, object)
Determines whether a license can be granted for the instance of the specified type.
Parameters
A that represents the type of object that requests the license.
An object of the specified type or a type derived from the specified type.
Returns
An valid license.
Examples
Exceptions
The type is licensed, but a License cannot be granted.
ValidateAsync(Type, CancellationToken)
Determines whether a license can be granted for the specified type.
Parameters
A that represents the type of object that requests the license.
(Optional) A token that allows processing to be cancelled.
Returns
Exceptions
ValidateAsync(Type, object, CancellationToken)
Determines whether a license can be granted for the instance of the specified type.
Parameters
A that represents the type of object that requests the license.
An object of the specified type or a type derived from the specified type.
(Optional) A token that allows processing to be cancelled.
Returns
An valid license.
Exceptions
The type is licensed, but a License cannot be granted.
Last updated