DeleteFeature(FeatureName: String): UiLicenseStatusCode;
DeleteFeature(FeatureName: String): UiLicenseStatusCode;
FeatureName.Feature name.
The DeleteFeature method deletes license code from the current session (from memory).
The method is relevant for use only if a stand-alone license is used. Otherwise the appropriate message is displayed.
If activation code is saved to the license file, the code is to be removed manually.
To execute the example, place the Button and Editbox components with the Button1 and Editbox1 identifiers on the form and add a link to the the Ui system assembly. The example is a handler of the OnClick event for the Button1 component. A stand-alone license should be used.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
LicManager: IUiLicenseManager;
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 code for the feature determined in Editbox from the current session. The message displays result of code deletion.
To execute the example, add links to the Ui, Fore, ForeSystem system assemblies. Place the Button and TextBox components with the Button1 and TextBox1 identifiers on the form. The example is a handler of the OnClick event for the Button1 component. The result of the Fore.NET example execution matches with the Fore example.
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;
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 deleted", New IWin32WindowForeAdapter(Self));
Else
WinApp.InformationBox("Error: " + StatusCode.ToString(), New IWin32WindowForeAdapter(Self));
End If;
End Sub;
See also: