IForeNETForm.InitForm

Fore Syntax

InitForm: Boolean;

Fore.NET Syntax

InitForm: Boolean;

Description

The InitForm method performs base setup of .NET form and returns whether setup successfully completed.

Comments

Executing the method makes the following changes:

Executing the method returns True if all changes are successfully made.

Fore Example

Executing this example requires that the repository contains a .NET assembly with the Assembly_1 identifier.

Sub CreateNETForm;
Var
    MB: IMetabase;
    NetForm: IForeNETForm;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_NETFORM;
    CrInfo.Name := "New form";
    CrInfo.Id := MB.GenerateId("NewForm");
    CrInfo.Permanent := True;
    CrInfo.Parent := MB.ItemById("Assembly_1");
    NetForm := MB.CreateObject(CrInfo).Bind As IForeNETForm;
    NetForm.InitForm;
End Sub CreateNETForm;

On executing the example a new .NET form is created in the specified .NET assembly.

Fore.NET Example

Executing this example requires that the repository contains a .NET assembly with the Assembly_1 identifier. This procedure is an entry point for the .NET assembly.

Imports Prognoz.Platform.Interop.ForeNet;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    NetForm: IForeNETForm;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    MB := Params.Metabase;
    CrInfo := MB.CreateCreateInfo();
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_NETFORM As Integer;
    CrInfo.Name := "New form";
    CrInfo.Id := MB.GenerateId("NewForm"0);
    CrInfo.Permanent := True;
    CrInfo.Parent := MB.ItemById["Assembly_1"];
    NetForm := MB.CreateObject(CrInfo).Bind() As IForeNETForm;
    NetForm.InitForm();
End Sub;

On executing the example a new .NET form is created in the specified .NET assembly.

See also:

IForeNETForm