ILicenseManager.CheckinCommuterLicense

Fore Syntax

CheckinCommuterLicense(FeatureName: String): UiLicenseStatusCode;

Fore.NET Syntax

CheckinCommuterLicense(System.String): Prognoz.Platform.Interop.ForeSystem.UiLicenseStatusCode;

Parameters

FeatureName. Feature name.

Description

The CheckinCommuterLicense method checks in a local license, enabling the temporary use of application offline, to license server.

Comments

The method is relevant after a temporary license is checked out from license server using the ILicenseManager.CheckoutCommuterLicense method.

To successfully check in license to server, license search settings and settings determined at the moment when temporary license was checked out from license server should match.

Fore 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;
    Feature: String;
    FeatureInfo: ILicenseFeatureInfo;
    StatusCode: UiLicenseStatusCode;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Feature := EditBox1.Text;
    FeatureInfo := LicManager.FeatureInfo(Feature);
    
If LicManager.IsCheckedOut(Feature) Then
        StatusCode := LicManager.CheckinCommuterLicense(Feature);
        
If StatusCode = UiLicenseStatusCode.Success Then
            WinApplication.InformationBox(
"License is successfully checked in");
        
Else
            WinApplication.InformationBox(
"Error: " + StatusCode.ToString);
        
End If;
    
Else
        WinApplication.InformationBox(
"License is not checked out from server");
    
End If;
End Sub Button1OnClick;

Enter name of the preinstalled feature into Editbox, for example, PP_OLAP, and click the button. If the specified feature was previously checked out from license server, it is checked in. If errors occur on check out, the message with a code of the occurred error is displayed.

Fore.NET Example

To execute the example, place the Button and TextBox components named Button1 and TextBox1 on the form. Set the Multiline property to True for TextBox.

Add links to the Host, Ui, Fore, ForeSystem system assemblies.

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

Imports Prognoz.Platform.Interop.Host;
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: ILicenseManager;
    Feature: String;
    FeatureInfo: ILicenseFeatureInfo;
    StatusCode: UiLicenseStatusCode;
Begin
    Svc := Self.Metabase 
As IForeServices;
    RunContext := Svc.GetRuntime().Context;
    LicManager := WinApp.Instance[RunContext].LicenseManager;
    Feature := textBox1.Text;
    FeatureInfo := LicManager.FeatureInfo(Feature);
    
If LicManager.IsCheckedOut(Feature) Then
        StatusCode := LicManager.CheckinCommuterLicense(Feature);
        
If StatusCode = UiLicenseStatusCode.lscSuccess Then
            WinApp.InformationBox(
"License is successfully checked in"New IWin32WindowForeAdapter(Self));
        
Else
            WinApp.InformationBox(
"Error: " + StatusCode.ToString(), New IWin32WindowForeAdapter(Self));
        
End If;
    
Else
        WinApp.InformationBox(
"License is not checked out from server"New IWin32WindowForeAdapter(Self));
    
End If;
End Sub;

The example of Fore.NET example execution matches with that in the Fore example.

See also:

ILicenseManager