Licenseable
Namespace: Babel.Licensing Assembly: Babel.Licensing.dll
Provides a set of static (Shared in Visual Basic) methods for objects that implement .
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
AddLicense<T>(T, ILicense)
An extension method that adds a license to the current license builder.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
| The license to add. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
Build(ILicense)
An extension method that converts the input license to a object.
Parameters
Name | Description |
---|---|
| The license to act on. |
Returns
Name | Description |
---|---|
A that represents the input license object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
CopyFrom<T>(T, T)
An ILicense extension method that copies ILicense objects.
Parameters
Name | Description |
---|---|
| The license to act on. |
| Another instance to copy. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ExpiresAt<T>(T, DateTime?)
An extension method that is used to assign an expiration date to the license object.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The expire date. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ForAnyAssembly<T>(T)
An extension method that is used to license all assemblies
Parameters
Name | Description |
---|---|
| The license to act on. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ForAnyComponent<T>(T)
An extension method used to license any component.
Parameters
Name | Description |
---|---|
| The license to act on. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ForAssembly<T>(T, Assembly)
An extension method that is used to partially fill the objects with the information provided by the given .
Parameters
Name | Description |
---|---|
| The license to act on. |
| The assembly from which the license information are retrieved. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter . |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ForAssembly<T>(T, string)
An extension method that is used to partially fill the objects with the information provided by the full assembly name.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The assembly full name. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter . |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ForBetaTesters<T>(T, string, string, DateTime?)
An extension method used to add a object to the license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| Information about recent changes introduced with this beta release. |
| The build type. |
| Defines a period after which this beta expires. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ForProduct<T>(T, string, string, string, string, string)
An extension method that is used to provide information about the licensed product.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The product name. |
| The product version. |
| A description about the product. |
| An URL where to find additional product information. |
| Product copyright information. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
IssuedAt<T>(T, DateTime?)
An extension method that is used to assign the license issue date.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The issue date. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
LicensedTo<T>(T, string, string, string, string, byte[])
An extension method that is used to fill licensee information.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The licensee name. |
| Information describing the contact. |
| The licensee company. |
| An URL where to find licensee information. |
| Custom licensee data. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
Load(ILicenseBuilder, string)
An extension method that loads the license from a given file.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
| The file to be read. |
Returns
Name | Description |
---|---|
The input object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
NotForVirtualEnvironment<T>(T)
An ILicense extension method that is used to prevent the execution of the application in a virtual environment.
Parameters
Name | Description |
---|---|
| The license to act on. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
RemoveLicense<T>(T, ILicense)
An extension method that removes the given license object from the current license builder.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
| The license to remove. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
RestrictedToProcess<T>(T, params string[])
An ILicense extension method that is used to restrict the license usage to a list of process names.
Parameters
Name | Description |
---|---|
| The license to act on. |
| A variable-length parameters list containing the process names. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
Save<T>(T, string)
An extension method that saves the license to a file.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
| The file to be saved. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
SignWith(ILicense, ISignatureProvider)
An ILicense extension method that is used to sign the current license object with the given .
Parameters
Name | Description |
---|---|
| The license to act on. |
| The signature provider object. |
Returns
Name | Description |
---|---|
The input object. |
Examples
This example shows how to sign a license with an RSA signature.
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
SignWith(ILicenseBuilder, ISignatureProvider)
An extension method used to sign the current license state with a given signature provider.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
| The signature provider. |
Returns
Name | Description |
---|---|
The input object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
SignWithKeys(ILicense, string, string)
An ILicense extension method that is used to sign the current license object with the given key pair.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The public key. |
| The private key. |
Returns
Name | Description |
---|---|
The input object. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments have unsupported or illegal values. |
SignWithKeys(ILicenseBuilder, string, string)
An extension method used to sign the current license state with a given key pair.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
| The public key. |
| The private key. |
Returns
Name | Description |
---|---|
The input object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments have unsupported or illegal values. |
SupportExpiresAt<T>(T, DateTime?)
An extension method that is used to assign the support expiration date to the license object.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The support expire date. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ToReadableString(ILicenseBuilder, string)
An ILicenseBuilder extension method that converts the current license to a readable string.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
| (Optional) Describes the format to use. |
Returns
Name | Description |
---|---|
The input object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments have unsupported or illegal values. |
ToRestrictedDomain<T>(T, string, string)
An ILicense extension method used to add a object to the license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The domain name. |
| The server role. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
UseOnlyAt<T>(T, string)
An ILicense extension method used to add a object to the license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The license usage mode. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
ValidateSignature(ILicenseBuilder)
An extension method that validates the current license signature.
Parameters
Name | Description |
---|---|
| The license builder to act on. |
Returns
Name | Description |
---|---|
The input object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments have illegal values or when the signature is not valid. |
ValidateWith(ILicense, ISignatureProvider)
An ILicense extension method that validates the current license object with the given .
Parameters
Name | Description |
---|---|
| The license to act on. |
| The signature provider object. |
Returns
Name | Description |
---|---|
The input object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments have unsupported or illegal values. |
ValidateWithPublicKey(ILicense, string)
An ILicense extension method that validates the current license object with the given public key.
Parameters
Returns
Name | Description |
---|---|
The input object. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments have unsupported or illegal values. |
WithComponents<T>(T, params string[])
An extension method used to add component information.
Parameters
Name | Description |
---|---|
| The license to act on. |
| A variable-length parameters list containing the components. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
WithFeature<T>(T, string, string, byte[], DateTime?, byte[])
An extension method that add a feature to the license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The feature name. |
| A description about the feature. |
| Custom feature data. |
| The feature expire date. |
| The feature key. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when the feature with the given name is already present in the features collection. |
WithFeature<T>(T, Feature)
An extension method that add a feature to the license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The feature object to add. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when the feature with the given name is already present in the features collection. |
WithFeatures<T>(T, params Feature[])
An extension method that is used to add several license objects.
Parameters
Name | Description |
---|---|
| The license to act on. |
| A variable-length parameters list containing objects. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when a feature with a given name is already present in the feature collection. |
WithField<T>(T, string, string)
An extension method that is used to add license fields.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The field name. |
| The field value. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when the field with the given name is already present in the collection. |
WithFields<T>(T, IDictionary<string, string>)
An extension method that is used to add a dictionary of fields.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The dictionary of license fields to add. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when a field with a given name is already present in the field collection. |
WithFields<T>(T, params Field[])
An extension method that is used to add several license fields.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The license fields to add. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when a field with a given name is already present in the field collection. |
WithHardwareKey<T>(T, string)
An extension method used to add a object to the license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The hardware key. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
WithId<T>(T, string)
An extension method used to assign an Id to the license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The string identifier. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
WithMaxSites<T>(T, int)
Sets the maximum number of floating or activation sites allowed for the license.
Parameters
Name | Description |
---|---|
| The license to which the maximum sites will be applied. |
| The maximum number of floating or activation sites allowed for the license. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when the provided license is null. |
WithMaximumRunCount<T>(T, int?)
Defines a trial license that allow the application to run only for given number of times.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The maximum number of times the application can run. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments are outside the required range. |
WithMaximumRunningInstances<T>(T, int?)
Defines a trial license that allow only given number of application instances running simultaneously.
Parameters
Name | Description |
---|---|
| The license to act on. |
| Number of permitted instances. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments are outside the required range. |
WithRestrictions<T>(T, params Restriction[])
An extension method that is used to add several license objects.
Parameters
Name | Description |
---|---|
| The license to act on. |
| A variable-length parameters list containing objects. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when a restriction with a given name is already present in the restriction collection. |
WithTrialDays<T>(T, int?)
Defines a trial license which can be used for a limited number of days.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The number of trial days. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Examples
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. | |
Thrown when one or more arguments are outside the required range. |
WithTrialRunTime<T>(T, TimeSpan?)
Defines a trial license which can run for a limited time period.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The trial run time. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
WithType<T>(T, string)
An extension method that is used to assign the license type.
Parameters
Name | Description |
---|---|
| The license to act on. |
| The license type. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic type parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
WithUniqueId<T>(T, string, int)
An extension method that is used to assign a unique identifier to a license.
Parameters
Name | Description |
---|---|
| The license to act on. |
| An optional identifier prefix. |
| The id length. |
Returns
Type Parameters
Name | Description |
---|---|
| Generic parameter. |
Exceptions
Name | Description |
---|---|
Thrown when one or more required arguments are null. |
Last updated