ILicenseManager.DeleteFeature

Fore Syntax

DeleteFeature(FeatureName: String): UiLicenseStatusCode;

Fore.NET Syntax

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

Parameters

FeatureName.Feature name.

Description

The DeleteFeature method deletes license code from the current session (from memory).

Comments

The method is relevant when a stand-alone license is used, otherwise the appropriate message is displayed.

If activation code was saved in the license file, the code should be deleted manually.

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;
    StatusCode: UiLicenseStatusCode;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Feature := Editbox1.Text;
    StatusCode := LicManager.DeleteFeature(Feature);
    
If StatusCode = UiLicenseStatusCode.Success Then
        WinApplication.InformationBox(
"Code is successfully deleted");
    
Else
        WinApplication.InformationBox(
"Error: " + StatusCode.ToString);
    
End If;

End Sub Button1OnClick;

Clicking the button deletes the code for the feature specified in Editbox for the current session. The appropriate message is displayed with code deleting result. If errors occur on deleting, the message with the code of the occurred error is displayed.

Fore.NET Example

To execute the example, place the Button and TextBox named Button1 and TextBox1 on the form.

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;
    StatusCode: UiLicenseStatusCode;
Begin
    Svc := Self.Metabase 
As IForeServices;
    RunContext := Svc.GetRuntime().Context;
    LicManager := WinApp.Instance[RunContext].LicenseManager;
    Feature := textBox1.Text;
    StatusCode := LicManager.DeleteFeature(Feature);
    
If StatusCode = UiLicenseStatusCode.lscSuccess Then
        WinApp.InformationBox(
"Code is successfully is deleted"New IWin32WindowForeAdapter(Self));
    
Else
        WinApp.InformationBox(
"Error: " + StatusCode.ToString(), New IWin32WindowForeAdapter(Self));
    
End If;
End Sub;

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

See also:

ILicenseManager