ILicenseManager.FeatureInfo

Fore Syntax

FeatureInfo(FeatureName: String): ILicenseFeatureInfo;

Fore.NET Syntax

FeatureInfo(System.String): Prognoz.Platform.Interop.Host.ILicenseFeatureInfo;

Parameters

FeatureName. Feature name.

Description

The FeatureInfo method gets information on a feature.

Fore Example

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;
    FeatureInfo: ILicenseFeatureInfo;
    Info: IStringList;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Feature := EditBox1.Text;
    FeatureInfo := LicManager.FeatureInfo(Feature);
    Memo1.Clear;
    Info := Memo1.Lines;
    
If FeatureInfo <> Null Then
        Info.Add(
"Feature name: " + FeatureInfo.FeatureName);
        Info.Add(
"License description: " + FeatureInfo.Description);
        Info.Add(
"Locking code: " + FeatureInfo.ClientLockInfo);
        Info.Add(
"Ability to check out local license: " + FeatureInfo.CommuterAllowed.ToString);
        Info.Add(
"Effective from: " + FeatureInfo.StartDate.ToString);
        Info.Add(
"Effective to: " + 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(
"Restricted(False)/Unrestricted(True) license: " + FeatureInfo.NoExpiration.ToString);
        Info.Add(
"Number of days when license expires: " + FeatureInfo.DaysLeft.ToString);
        Info.Add(
"License server name: " + LicManager.Server);
        Info.Add(
"License number: " + FeatureInfo.LicenseIds.AsString);
    
Else
        Info.Add(
"Information about license = Null");
    
End If;
End Sub Button1OnClick;

Enter name of the preinstalled feature into Editbox, for example, PP_OLAP, and click the button. Information about the specified feature will be displayed in Memo1.

Fore.NET Example

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;
    FeatureInfo: ILicenseFeatureInfo;
    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.FeatureInfo(Feature);
    textBox2.Clear();
    
If FeatureInfo <> Null Then
        Info.Add(
"Feature name: " + FeatureInfo.FeatureName);
        
Info.Add("License description: " + FeatureInfo.Description);
        Info.Add(
"Locking code: " + FeatureInfo.ClientLockInfo);
        Info.Add(
"Ability to check out local license: " + FeatureInfo.CommuterAllowed.ToString());
        Info.Add(
"Effective from: " + FeatureInfo.StartDate.ToString());
        Info.Add(
"Effective to: " + 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(
"Restricted(False)/Unrestricted(True) license: " + FeatureInfo.NoExpiration.ToString());
        Info.Add(
"Number of days when license expires: " + FeatureInfo.DaysLeft.ToString());
        Info.Add(
"License server name: " + LicManager.Server);
        Info.Add(
"License number: " + FeatureInfo.LicenseIds);
    
Else
        Info.Add(
"Information about license = Null");
    
End If;
    textBox2.Lines := info.ToArray();
End Sub;

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

See also:

ILicenseManager