GetFeatureInfo(FeatureName: String): IUiLicenseFeatureInfo;
GetFeatureInfo(FeatureName: String): IUiLicenseFeatureInfo;
FeatureName. Feature name.
The GetFeatureInfo method gets information on a feature.
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;
FeatureInfo: IUiLicenseFeatureInfo;
Info: IStringList;
Begin
LicManager := WinApplication.Instance.LicenseManager;
Feature := EditBox1.Text;
FeatureInfo := LicManager.GetFeatureInfo(Feature);
Memo1.Clear;
Info := Memo1.Lines;
If FeatureInfo <> Null Then
Info.Add("Feature name: " + FeatureInfo.FeatureName);
Info.Add("Locking code: " + FeatureInfo.ClientLockInfo);
Info.Add("Possibility to check out local license: " + FeatureInfo.CommuterAllowed.ToString);
Info.Add("Start date: " + FeatureInfo.StartDate.ToString);
Info.Add("End date: " + FeatureInfo.ExpireDate.ToString);
Info.Add("License type (0-Standalone/1-NetWork): " + FeatureInfo.LicenseMode.ToString);
Info.Add("Demo or permanent (0)/trial (1): " + FeatureInfo.LicenseType.ToString);
Info.Add("Locking type (0-Unlocked;1-ClientLocked;2-ServerLocked): " + FeatureInfo.LockType.ToString);
Info.Add("Trial period length: " + FeatureInfo.TrialDaysCount.ToString);
Info.Add("Number of days before license expiry date: " + FeatureInfo.DaysLeft.ToString);
Info.Add("License server name: " + LicManager.Server);
Else
Info.Add("License information = Null");
End If;
End Sub Button1OnClick;
Enter to Editbox name of pre-installed feature, for example, PP_OLAP, and click the button. Information about the specified feature will be displayed in Memo1.
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 hander of the OnClick event for the Button1 component. The example of the Fore.NET example execution matches with that in the Fore example.
Imports Prognoz.Platform.Interop.Fore;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Ui;
...
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
WinApp: WinApplicationClassClass = New WinApplicationClassClass();
Svc: IForeServices;
RunContext: ForeRuntimeContext;
LicManager: IUiLicenseManager;
Feature: String;
FeatureInfo: IUiLicenseFeatureInfo;
Info: List<String> = New List<string>();
Begin
Svc := Self.Metabase As IForeServices;
RunContext := Svc.GetRuntime().Context;
LicManager := WinApp.Instance[RunContext].LicenseManager;
Feature := textBox1.Text;
FeatureInfo := LicManager.GetFeatureInfo(Feature);
textBox2.Clear();
If FeatureInfo <> Null Then
Info.Add("Feature name: " + FeatureInfo.FeatureName);
Info.Add("Locking code: " + FeatureInfo.ClientLockInfo);
Info.Add("Possibility of checking out local license: " + FeatureInfo.CommuterAllowed.ToString());
Info.Add("Start action: " + FeatureInfo.StartDate.ToString());
Info.Add("End action: " + FeatureInfo.ExpireDate.ToString());
Info.Add("License type (0-Standalone/1-NetWork): " + FeatureInfo.LicenseMode.ToString());
Info.Add("Demo or permanent (0)/trial (1): " + FeatureInfo.LicenseType.ToString());
Info.Add("Binding type (0-Unlocked;1-ClientLocked;2-ServerLocked): " + FeatureInfo.LockType.ToString());
Info.Add("Trial period length: " + FeatureInfo.TrialDaysCount.ToString());
Info.Add("Number of days before license expiry date: " + FeatureInfo.DaysLeft.ToString());
Info.Add("License server name: " + LicManager.Server);
Else
Info.Add("License information = Null");
End If;
textBox2.Lines := info.ToArray();
End Sub;
See also: