IForeSerializer.SaveAssemblyToFile

Fore Syntax

SaveAssemblyToFile(Assembly: IAssembly; FileName: String);

Fore.NET Syntax

SaveAssemblyToFile(Assembly: Prognoz.Platform.Interop.Metabase.IAssembly; FileName: String);

Parameters

Assembly is the repository assembly that should be saved into the file.

FileName is a path and name of the file in which the assembly is saved.

Description

The SaveAssemblyToFile method saves the assembly into the specified file.

Comments

The ppassembly extension must be specified for the file where the file is saved.

Fore Example

Executing the example requires that the repository contains an assembly with the Assembly_1 identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Fs: IForeSerializer;
    MObj: IMetabaseObjectDescriptor;
    Assm: IAssembly;
Begin
    MB := MetabaseClass.Active;
    Fs := New ForeSerializer.Create;
    MObj := MB.ItemById("Assembly_1");
    Assm := MObj.Bind As IAssembly;
    Fs.SaveAssemblyToFile(Assm, "c:\" + MObj.Id + ".ppassembly");
End Sub UserProc;

The specified assembly is saved in the file in disk C root after executing this example.

Fore.NET Example

Executing the example requires that the repository contains an assembly with the Assembly_1 identifier.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.KeFore;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Fs: IForeSerializer = New ForeSerializerClass();
    MObj: IMetabaseObjectDescriptor;
    Assm: IAssembly;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["Assembly_1"];
    Assm := MObj.Bind() As IAssembly;
    Fs.SaveAssemblyToFile(Assm, "c:\" + MObj.Id + ".ppassembly");
End Sub;

This procedure is the entry point for the .NET assembly. This assembly is saved in the file in disk C root during the procedure execution.

See also:

IForeSerializer