CommuterInfo(FeatureName: String): ILicenseCommuterInfo;
CommuterInfo(System.String): Prognoz.Platform.Interop.Host.ILicenseCommuterInfo;
FeatureName. Feature name.
The GetCommuterInfo method gets information about a temporary local feature checked out from license server.
The method is relevant after a temporary local license is checked out from license server using the ILicenseManager.CheckoutCommuterLicense method. The ILicenseManager.IsCheckedOut method checks if a feature is checked out from license server.
If a feature is not checked out from license server, the method returns NULL.
To execute the example, place the Button, Editbox and Memo components named Button1, Editbox1 and Memo1 on the form.
Add links to the Host, Ui, Forms, Collections 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;
CommuterInfo: ILicenseCommuterInfo;
Info: IStringList;
Begin
LicManager := WinApplication.Instance.LicenseManager;
Feature := EditBox1.Text;
Memo1.Clear;
Info := Memo1.Lines;
CommuterInfo := LicManager.CommuterInfo(Feature);
If LicManager.IsCheckedOut(Feature) Then
CommuterInfo := LicManager.CommuterInfo(Feature);
If CommuterInfo <> Null Then
Info.Add("Feature name: " + CommuterInfo.FeatureName);
Info.Add("License description: " + LicManager.FeatureDescription(Feature));
Info.Add("Effective from: " + CommuterInfo.StartDate.ToString);
Info.Add("Effective to: " + CommuterInfo.ExpireDate.ToString);
Info.Add("License server IP: " + CommuterInfo.IssuingServer);
End If;
Else
Info.Add("Feature 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 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 appropriate message is displayed.
To execute the example, place the Button component and two TextBox components named Button1, TextBox1 and TextBox2 on the form. Set the Multiline property to True for the second TextBox2 component.
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;
CommuterInfo: ILicenseCommuterInfo;
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.CommuterInfo(Feature);
If CommuterInfo <> Null Then
Info.Add("Feature name: " + CommuterInfo.FeatureName);
Info.Add("License description: " + LicManager.FeatureDescription[Feature]);
Info.Add("Effective from: " + CommuterInfo.StartDate.ToString());
Info.Add("Effective to: " + CommuterInfo.ExpireDate.ToString());
Info.Add("License server IP: " + CommuterInfo.IssuingServer);
End If;
Else
Info.Add("Feature is not checked out from server");
End If;
textBox2.Lines := info.ToArray();
End Sub;
The example of Fore.NET example execution matches with that in the Fore example.
See also: