Click or drag to resize
Habanero.Licensing.Validation Namespace
Contains types used for validating and working with licenses in the end-user environment.
Classes
  ClassDescription
Public classLicenseHelper Obsolete.
Public classLicenseValidationResult
Indicates the result of a license check.
Public classLicenseValidator
Used for validating licenses prevously stored or entered by a user. Also supports directly activating a trial.
Enumerations
  EnumerationDescription
Public enumerationLicenseIssue
LicenseIssue represents reasons why a license is invalid.
Public enumerationLicenseLocation
Represent the storage location for the license.
Public enumerationLicenseState
Represents the state of the license.
Examples
Below is an example of performing simple validation
 string[] StandardOrHigher = new string[3] { "Standard", "Pro", "Enterprise" };
string[] ProOrHigher = new string[2] { "Pro", "Enterprise" };
string[] EnterpriseOrHigher = new string[1] { "Enterprise" };

LicenseValidator validator = new LicenseValidator(LicenseLocation.File, LicenseFileLocation, productName, publicKey, applicationSecret, ThisVersion);
LicenseValidationResult result = validator.CheckLicense();

switch (result.State)
{
    case LicenseState.Valid:
        //users license is valid
        break;
    case LicenseState.Trial:
        //users license is trial
        break;
    default:
        //users license is invalid
        break;
}

//check what edition we are running

if (validator.IsEdition(EnterpriseOrHigher))
{
    //enable enteprise features           
}

if (validator.IsEdition(ProOrHigher))
{
    //enable pro features
}

if (validator.IsEdition(StandardOrHigher))
{
    //enable standard features
}
Note: This example is incomplete.