SaveModuleToFile(Module: IModule; FileName: String);
SaveModuleToFile(Module: Prognoz.Platform.Interop.Metabase.IModule; FileName: String);
Module is a repository unit that should be saved to the file.
FileName is a path and name of the file, in which the unit is saved.
The SaveModuleToFile method saves a unit into the specified file.
The "ppmodule" extension should be specified for a file, in which the unit is saved.
Executing the example requires that the repository contains a unit with the Module_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
Fs: IForeSerializer;
MObj: IMetabaseObjectDescriptor;
Module: IModule;
Begin
MB := MetabaseClass.Active;
Fs := New ForeSerializer.Create;
MObj := MB.ItemById("Module_1");
Module := MObj.Bind As IModule;
Fs.SaveModuleToFile(Module, "c:\" + MObj.Id + ".ppmodule");
End Sub UserProc;
After executing the example the specified unit is saved to the file in the disk C root.
Executing the example requires that the repository contains a unit with the Module_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;
Module: IModule;
Begin
MB := Params.Metabase;
MObj := MB.ItemById["Module_1"];
Module := MObj.Bind() As IModule;
Fs.SaveModuleToFile(Module, "c:\" + MObj.Id + ".ppmodule");
End Sub;
This procedure is the entry point for the .NET assembly. The specified unit is saved in the file in the disk C root during the procedure execution.
See also: