SaveFormToFile(Form: IForeNETForm; FileName: String);
Form is a .NET form to be saved into a file.
FileName is a path and name of the file, to which the .NET form is saved. The specified file must have the ppnform extension.
The SaveFormToFile method saves the specified .NET form to the specified file.
The .NET form, its internal unit and file with resources are saved into the file at call of this method.
Executing this example requires that the repository contains a .NET assembly with the NETAssembly_1 identifier. This .NET assembly contains a .NET form with the TestForm identifier.
Sub UserProc;
Var
MB: IMetabase;
Fs: IForeNETSerializer;
MObj: IMetabaseObjectDescriptor;
NETForm: IForeNETForm;
Begin
MB := MetabaseClass.Active;
Fs := New ForeNETSerializer.Create;
MObj := MB.ItemByIdNamespace("TestForm", MB.ItemById("NETAssembly_1").Key);
NETForm := MObj.Bind As IForeNETForm;
Fs.SaveFormToFile(NETForm, "c:\" + MObj.Id + ".ppnform");
End Sub UserProc;
The specified .NET form is saved to the file in root of disk C at executing this example.
See also: