IUiLicenseManager.GetCommuterInfo

Fore Syntax

GetCommuterInfo(FeatureName: String): IUiLicenseCommuterInfo;

Fore.NET Syntax

GetCommuterInfo(FeatureName: String): IUiLicenseCommuterInfo;

Parameters

FeatureName. Feature name.

Description

The GetCommuterInfo method gets information about temporary local feature checked out from license server.

Comments

The method can be used if a temporary local license was previously checked out from license server using the CheckoutCommuterLicense method. The IUiLicenseManager.IsCheckedOut method checks if a feature is checked out from license server.

If a feature is not checked out from the license server, the method returns NULL.

Fore Example

To execute the example, place the Button, Editbox and Memo components with the Button1, Editbox1 and Memo1 identifiers on the form and add a link to the Ui system assembly. The example is a handler of the OnClick event for the Button1 component

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var 
    LicManager: IUiLicenseManager;
    Feature: String;
    CommuterInfo: IUiLicenseCommuterInfo;
    Info: IStringList;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Feature := EditBox1.Text;
    Memo1.Clear;
    Info := Memo1.Lines;
    If LicManager.IsCheckedOut(Feature) Then
        CommuterInfo := LicManager.GetCommuterInfo(Feature);
        If CommuterInfo <> Null Then
            Info.Add("Licensing unit names: " + CommuterInfo.FeatureName);
            Info.Add("Action start: " + CommuterInfo.StartDate.ToString);
            Info.Add("Action end: " + CommuterInfo.ExpireDate.ToString);
            Info.Add("IP of licensing server: " + CommuterInfo.IssuingServer);
        End If;
    Else 
        Info.Add("Licensing unit is not checked out from server");
    End If;
End Sub Button1OnClick;

Enter to Editbox name of pre-installed feature, for example, PP_OLAP, and click the button. If a temporary local license was checked out from license server, clicking the button in Memo displays information about it. If a temporary local license is not checked out from server, the message is displayed.

Fore.NET Example

To execute the example, add links to the Ui, Fore, ForeSystem system assemblies. Place one Button and two TextBox components with the Button1, TextBox1 and TextBox2 identifiers on the form. Set the Multiline property to True for the second TextBox2 component. The example is a handler of the OnClick event for the Button1 component. The result of the Fore.NET example execution matches with that in the Fore example.

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

...

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var 
    WinApp: WinApplicationClassClass = New WinApplicationClassClass();
    Svc: IForeServices;
    RunContext: ForeRuntimeContext;
    LicManager: IUiLicenseManager;
    Feature: String;
    CommuterInfo: IUiLicenseCommuterInfo;
    Info: List<String> = New List<string>();
Begin
    Svc := Self.Metabase As IForeServices;
    RunContext := Svc.GetRuntime().Context;
    LicManager := WinApp.Instance[RunContext].LicenseManager;
    textBox2.Clear();
    Feature := textBox1.Text;
    If LicManager.IsCheckedOut(Feature) Then
        CommuterInfo := LicManager.GetCommuterInfo(Feature);
        If CommuterInfo <> Null Then
            Info.Add("Licensing unit names: " + CommuterInfo.FeatureName);
            Info.Add("Action start: " + CommuterInfo.StartDate.ToString());
            Info.Add("Action end: " + CommuterInfo.ExpireDate.ToString());
            Info.Add("IP of license server: " + CommuterInfo.IssuingServer);
        End If;
    Else 
        Info.Add("Licensing unit is not checked out from server");
    End If;
    textBox2.Lines :=  info.ToArray();

End Sub;

See also:

IUiLicenseManager | Licensing Options