IForeSerializerLoader.LoadForm

Syntax

LoadForm: IForm;

Description

The LoadForm method loads and saves the form into repository.

Comments

The method saves the form in accordance with the parameters specified in the CreateInfo property. If there is an object in repository that has the same identifier with the form being loaded, the exception is generated.

Example

Executing the example requires the c:\Form_1.ppform file that contains a saved platform form.

Sub UserProc;
Var
    MB: IMetabase;
    Fs: IForeSerializer;
    Loader: IForeSerializerLoader;
    Id: String;
Begin
    MB := MetabaseClass.Active;
    Fs := New ForeSerializer.Create;
    Loader := Fs.CreateLoaderFromFile("c:\Form_1.ppform", MB);
    Id := Loader.CreateInfo.Id;
    If MB.ItemById(Id) <> Null Then
        Loader.CreateInfo.Id := MB.GenerateId(Id);
        Loader.CreateInfo.Name := Loader.CreateInfo.Name + "_Copy";
    End If;
    Loader.CreateInfo.Parent := MB.Root;
    Loader.LoadForm;
End Sub UserProc;

Form is loaded from the specified file during example execution. Form is saved in the repository root. If there is an object that has the same identifier with the loading form in repository, the form identifier is changed before the loading.

See also:

IForeSerializerLoader