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
Name | Description |
---|---|
| A |
Returns
Name | Description |
---|---|
The license provider instance. |
IsLicensed(Type)
Returns whether the given type has a valid license.
Parameters
Name | Description |
---|---|
| The to find a valid license for. |
Returns
Name | Description |
---|---|
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
Name | Description |
---|---|
| The to find a valid license for. |
| (Optional) A token that allows processing to be cancelled. |
Returns
IsValid(Type)
Determines whether a valid license can be granted for the specified type.
Parameters
Name | Description |
---|---|
| A that represents the type of object that requests the license. |
Returns
Name | Description |
---|---|
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
Name | Description |
---|---|
| 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
Name | Description |
---|---|
true if a valid license can be granted; otherwise, false. |
RegisterLicenseProvider(Type, ILicenseProvider)
Registers the license provider.
Parameters
Name | Description |
---|---|
| A |
| The license provider instance. |
Examples
Validate(Type)
Determines whether a license can be granted for the specified type.
Parameters
Name | Description |
---|---|
| A that represents the type of object that requests the license. |
Examples
Exceptions
Name | Description |
---|---|
A License cannot be granted. |
Validate(Type, object)
Determines whether a license can be granted for the instance of the specified type.
Parameters
Name | Description |
---|---|
| 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
Name | Description |
---|---|
An valid license. |
Examples
Exceptions
Name | Description |
---|---|
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
Name | Description |
---|---|
| A that represents the type of object that requests the license. |
| (Optional) A token that allows processing to be cancelled. |
Returns
Exceptions
Name | Description |
---|---|
ValidateAsync(Type, object, CancellationToken)
Determines whether a license can be granted for the instance of the specified type.
Parameters
Name | Description |
---|---|
| 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
Exceptions
Name | Description |
---|---|
The type is licensed, but a License cannot be granted. |
Last updated