IWinApplication.LicenseManager

Syntax

LicenseManager: IUiLicenseManager;

Description

The LicenseManager property returns license manager.

Fore Example

Executing the example requires a form with a button and the EditBox component named EditBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    LicManager: IUiLicenseManager;
    Feature: String;
    FeatureInfo: IUiLicenseFeatureInfo;
    Status: UiLicenseStatusCode;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Feature := EditBox1.Text;
    FeatureInfo := LicManager.GetFeatureInfo(Feature);
    If FeatureInfo.CommuterAllowed Then
        Status := LicManager.CheckoutCommuterLicense(Feature);
        LicManager.Refresh;
        If Status <> 0 Then
            WinApplication.InformationBox(Status.ToString);
        End If;
    End If;
End Sub Button1OnClick;

A local license is checked out for the feature entered into the edit box, if it is possible. A message with error code is displayed if an error occurs.

Fore.NET Example

Executing the example requires a form with a button and the TextBox component named TextBox1.

Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Ui;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    WinAppCls: WinApplicationClass = New WinApplicationClassClass();
    WinApp: WinApplication = New WinApplicationClass_2();
    LicManager: IUiLicenseManager;
    Feature: String;
    FeatureInfo: IUiLicenseFeatureInfo;
    Status: UiLicenseStatusCode;
Begin
    LicManager := WinApp.LicenseManager;
    Feature := textBox1.Text;
    FeatureInfo := LicManager.GetFeatureInfo(Feature);
    If FeatureInfo.CommuterAllowed Then
        Status := LicManager.CheckoutCommuterLicense(Feature);
        LicManager.Refresh();
        If (Status As integer) <> 0 Then
            WinAppCls.InformationBox(Status.ToString(), New IWin32WindowForeAdapter(Self));
        End If;
    End If;
End Sub;

A local license is checked out for the feature entered into the edit box, if it is possible. A message with error code is displayed if an error occurs.

See also:

IWinApplication