IForeNETSerializer.CreateLoaderFromFile

Syntax

CreateLoaderFromFile(FileName: String; Metabase: IMetabase): IForeNETSerializerLoader;

Parameters

Reader is a file, from which .NET object is loaded.

Metabase is a repository in which the loaded .NET object is saved.

Description

The CreateLoaderFromFile method creates the object that loads the .NET objects from the file.

Example

Executing this example requires the NETAssembly_1.ppnassembly file in the root directory of disk C. The file contains the saved .NET assembly of the platform. The current repository contains the folder with the ASSEMBLY_FOLDER identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Fs: IForeNETSerializer;
    Fsl: IForeNETSerializerLoader;
    Id: String;
    NETAsm: IForeNETAssembly;
    MObj: IMetabaseObject;
Begin
    MB := MetabaseClass.Active;
    Fs := New ForeNETSerializer.Create;
    Fsl := Fs.CreateLoaderFromFile("c:\NETAssembly_1.ppnassembly", MB);
    Id := Fsl.CreateInfo.Id;
    If MB.ItemById(Id) <> Null Then
        Fsl.CreateInfo.Id := MB.GenerateId(Id);
        Fsl.CreateInfo.Name := Fsl.CreateInfo.Name + "_Copy";
    End If;
    Fsl.CreateInfo.Parent := MB.ItemById("ASSEMBLY_FOLDER");
    Fsl.LoadAssembly;
End Sub UserProc;

On executing the example, the .NET assembly is loaded into the current repository from the specified file. The .NET assembly is saved in the specified folder of repository.

See also:

IForeNETSerializer