ILicenseManager.RequestLicense

Syntax

LicenseRequest(FeatureName: String; Var License: ILicense; [Settings: ILicenseRequestSettings = Null]): UiLicenseStatusCode;

Parameters

FeatureName. Feature name.

License. License.

Settings. Object for working with a feature.

Description

The LicenseRequest method checks if the set feature exists, and returns check result.

Comments

The FeatureName parameter must be empty if the Settings parameter sends feature type using the ILicenseRequestSettings.FeatureType property.

A feature is checked for a network license.

After the work with the licensing block is finished, release the license using ILicense.LicenseRelease, that is, remove the object with the license.

Example

To execute the example, add a link to the Host system assembly.

Sub UserProc;
Var
    LicManager: ILicenseManager;
    Feature: String;
    Lic: ILicense;
    StatusCode: UiLicenseStatusCode;
    Settings: ILicenseRequestSettings;
Begin
    LicManager := New LicenseManager.Create;
    //Feature := "PP_ETL";
    Settings := New LicenseRequestSettings.Create;
    Settings.FeatureType := UiLicenseFeatureType.ETL;
    //StatusCode := LicManager.RequestLicense(Feature, Lic);
    StatusCode := LicManager.RequestLicense("", Lic, Settings);
    If StatusCode <> UiLicenseStatusCode.Success Then
        // handle licensing errors
        //...
    Else
        Debug.WriteLine("No licensing errors");
    End If;
    //Work with licensed block
    //...
    //After the work is finished, release license
    If Lic <> Null Then
        Lic.LicenseRelease;
    End If;
End Sub UserProc;

After executing the example the PP_ETL feature is requested. If license status check returned no errors, the console will display the corresponding message.

See also:

ILicenseManager