LicenseProviderBundle
Namespace: Babel.Licensing Assembly: Babel.Licensing.dll
Represents a bundle of license providers that implement the interface. This class allows you to combine multiple license providers and retrieve licenses from them sequentially.
Inheritance
object ← LicenseProviderBundle
Implements
IAsyncLicenseProvider, ILicenseProvider, ICollection<ILicenseProvider>, IEnumerable<ILicenseProvider>, IEnumerable
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
LicenseProviderBundle()
Initializes a new instance of the class. This class is used to combine multiple license providers and retrieve licenses from them sequentially.
Examples
Properties
Count
Gets the number of license providers in the bundle.
Property Value
IsReadOnly
Gets a value indicating whether the collection is read-only.
Property Value
ValidLicenseProvider
Returns the instance of the that validate successfully the license.
Property Value
Methods
Add(ILicenseProvider)
Adds a license provider to the bundle. The license provider will be used to retrieve a license if the previous license provider in the bundle failed to validate the license.
Parameters
The license provider to add.
Exceptions
Thrown when item
is null.
Clear()
Removes all license providers from the bundle.
Contains(ILicenseProvider)
Determines whether the bundle contains a specific license provider.
Parameters
The license provider to locate.
Returns
true if the license provider is found in the bundle; otherwise, false.
CopyTo(ILicenseProvider[], int)
Copies the license providers in the bundle to an array, starting at a particular array index.
Parameters
The one-dimensional array that is the destination of the elements copied from the bundle.
The zero-based index in array at which copying begins.
GetEnumerator()
Returns an enumerator that iterates through the license providers in the bundle.
Returns
An enumerator that can be used to iterate through the license providers in the bundle.
GetLicense(ILicenseContext, Type, object)
Synchronously gets a license for an instance or type of component from the bundle.
Parameters
A that specifies where you can use the licensed object.
A that represents the component requesting the license.
An object that is requesting the license.
Returns
A valid for the specified context, type, and instance.
GetLicenseAsync(ILicenseContext, Type, object, CancellationToken)
Asynchronously gets a license for an instance or type of component from the bundle.
Parameters
A that specifies where you can use the licensed object.
A that represents the component requesting the license.
An object that is requesting the license.
A token that can be used to request cancellation of the asynchronous operation.
Returns
A task that represents the asynchronous operation and contains a valid .
Remove(ILicenseProvider)
Removes a license provider from the bundle.
Parameters
The license provider to remove.
Returns
true if the license provider was successfully removed; otherwise, false.
Last updated