FeatureName: String;
FeatureName: String;
The FeatureName property returns feature name.
To execute the example, place the Button, Editbox and Memo components with the Button1, Editbox1 and Memo1 identifiers correspondingly on the form, connect 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;
Lic: IUiLicense;
StatusCode: UiLicenseStatusCode;
Info : IStringList;
Begin
LicManager := WinApplication.Instance.LicenseManager;
Feature := Editbox1.Text;
StatusCode := LicManager.LicenseRequest(Feature, Lic, True, UilicenseStorageType.File);
If StatusCode = UiLicenseStatusCode.Success Then
Lic.LicenseUpdate;
Memo1.Clear;
Info := Memo1.Lines;
Info.Add("FeatureName: " + Lic.FeatureName + ";");
Info.Add("IsCommuter: " + Lic.IsCommuter.ToString + ";");
Info.Add("Server: " + Lic.ServerName + ";");
Else
/// Handle licensing errors
///...
Return;
End If;
///After the end of work, license is checked in
If Lic <> Null Then
Lic.LicenseRelease;
End If;
End Sub Button1OnClick;
Enter to Editbox name of pre-installed feature, for example, PP_OLAP, and click the button. After it Memo displays information about feature specified in Editbox.
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.
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;
Lic: IUiLicense;
StatusCode: UiLicenseStatusCode;
Info: List<String> = New List<string>();
Begin
Svc := Self.Metabase As IForeServices;
RunContext := Svc.GetRuntime().Context;
LicManager := WinApp.Instance[RunContext].LicenseManager;
Feature := textBox1.Text;
StatusCode := LicManager.LicenseRequest(Feature, Var Lic, True, UiLicenseStorageType.ulstFile,RunContext);
If StatusCode = UiLicenseStatusCode.lscSuccess Then
Lic.LicenseUpdate();
Info.Add("FeatureName: " + Lic.FeatureName);
Info.Add("IsCommuter: " + Lic.IsCommuter.ToString());
Info.Add("Server: " + Lic.ServerName);
textBox2.Clear();
textBox2.Lines := info.ToArray();
Else
/// Handle licensing errors
///...
Return;
End If;
///After the end of work, license is released
If Lic <> Null Then
Lic.LicenseRelease();
End If;
End Sub;
Enter to TextBox1 name of pre-installed feature, for example, PP_OLAP, and click the button. After it, TextBox2 displays information about feature specified in TextBox1.
See also: