SaveModuleToFile(Module: IModule; FileName: String);
SaveModuleToFile(Module: Prognoz.Platform.Interop.Metabase.IModule; FileName: String);
Module is a repository module that should be saved to the file.
FileName is a path and name of the file in which the module is saved.
The SaveModuleToFile method saves a module into the specified file.
The "ppmodule" extension should be specified for a file in which the module is saved.
Executing the example requires that the repository contains a module 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;
The specified module is saved to the file in disk C root after executing this example.
Executing the example requires that the repository contains a module 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 module is saved in the file in disk C root during the procedure execution.
See also: