ServiceLicenseProvider
Namespace: Babel.Licensing Assembly: Babel.Licensing.dll
Represents an abstract class for providing service-based license validation.
Inheritance
object ← ServiceLicenseProvider
Derived
BabelServiceLicenseProvider, BabelServiceRegistryLicenseProvider
Implements
IAsyncLicenseProvider, ILicenseProvider
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
ServiceLicenseProvider(BabelLicensing)
Initializes a new instance of the class.
Parameters
Name | Description |
---|---|
| The BabelLicensing service. |
Properties
DeleteLicenseWhenRevoked
Gets or sets a value indicating whether the license should be deleted when it is revoked.
Property Value
FailTolerance
Gets or sets the number of times a license can fail remote validation before the locally cached license is deleted. This property is only used if ThrowExceptionWhenServiceUnavailable is set to false. If set to 0, the locally cached license will never be deleted.
Property Value
LicenseRefreshInterval
The interval at which the license will be validated with the remote server, instead of using the cached license key. If set to TimeSpan.Zero, the license will always be validated with the remote server.
Property Value
Service
The BabelLicensing service instance.
Property Value
ThrowExceptionWhenServiceUnavailable
Gets or sets a value indicating whether an exception should be thrown when the service is unavailable. If set to false, the cached license key will be used instead.
Property Value
UserKey
Gets or sets the user key associated with the activated license.
Property Value
Methods
CreateServiceLicenseContext(ILicenseContext)
Create the service license context.
Parameters
Name | Description |
---|---|
| The current license context. |
Returns
Name | Description |
---|---|
The service license context. |
DeleteServiceStore()
Deletes the local license store.
GetLicenseAsync(ILicenseContext, Type, object, CancellationToken)
Gets a license for the specified context, type, and instance asynchronously.
Parameters
Name | Description |
---|---|
| The license context. |
| The type requesting the license. |
| The instance requesting the license. |
| The cancellation token. |
Returns
GetServiceStore()
Retrieves the service license store associated with the current license provider.
Returns
Name | Description |
---|---|
An instance of representing the service license store. |
GetUserKey()
Get the user key associated with the activated license.
Returns
Name | Description |
---|---|
The user key associated with the license. |
OnFloatingLicenseLost(string, string, Exception)
Raise the event when a floating license is lost.
Parameters
Name | Description |
---|---|
| The user key. |
| The license token. |
| The error that caused the floating license to be lost. |
OnLicenseActivated(object, LicenseActivatedEventArgs)
Handles the event when a license is activated.
Parameters
Name | Description |
---|---|
| The source of the event. |
The instance containing the event data. |
OnLicenseDeactivated(object, LicenseDeactivatedEventArgs)
Handles the event when a license is deactivated.
Parameters
Name | Description |
---|---|
| The source of the event. |
The instance containing the event data. |
OnLicenseDeactivationError(object, LicenseDeactivationErrorEventArgs)
Handles the event when there's an error during license deactivation.
Parameters
Name | Description |
---|---|
| The source of the event. |
The instance containing the event data. |
OnLicenseValidated(object, LicenseValidatedEventArgs)
Handles the event when a license is validated.
Parameters
Name | Description |
---|---|
| The source of the event. |
The instance containing the event data. |
OnLicenseValidationError(object, LicenseValidationErrorEventArgs)
Handles the event when there's an error during license validation.
Parameters
Name | Description |
---|---|
| The source of the event. |
The instance containing the event data. |
ValidateLicenseKey(string, ILicenseContext, Type, object)
Validates the license key.
Parameters
Name | Description |
---|---|
| The license key. |
| A |
| A |
| An object that is requesting the license. |
Returns
Name | Description |
---|---|
A valid object. |
FloatingLicenseLost
Occurs when a floating license is lost.
Event Type
Last updated