ILicenseManager.AddFeature

Syntax

AddFeature(LicenseCode: String; [MakePermanent: Boolean=False]): UiLicenseStatusCode;

Parameters

LicenseCode. License activation code.

MakePermanent. The parameter is used to save activation code:

Description

The AddFeature method adds a license code.

Comments

The method is relevant if a stand-alone license is used. Otherwise the corresponding message is displayed.

Example

To execute the example, place the Button and Editbox buttons named Button1 and Editbox1 on the form.

Add links to the Host, Ui, Forms system assemblies.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    LicManager: ILicenseManager;
    LicString: String;
    StatusCode: UiLicenseStatusCode;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    LicString := Editbox1.Text;
    StatusCode := LicManager.AddFeature(LicString, False);
    If StatusCode = UiLicenseStatusCode.Success Then
        WinApplication.InformationBox("Code is successfully added");
    Else 
        WinApplication.InformationBox("Error: " + StatusCode.ToString);
    End If;
End Sub Button1OnClick;

After clicking the button the activation code specified in Editbox is added to be used in the current session. The appropriate message with code adding result is displayed. If errors occur on adding, the message with a code of the occurred error is displayed.

See also:

ILicenseManager