CreateInfo: IMetabaseObjectCreateInfo;
The CreateInfo property returns information about loaded .NET object.
By default this property returns the parameters of object, that is bound to the given .NET objects loader. The new object will be created in repository according to these parameters and the bound .NET object will be loaded and saved in it. Loading and saving are performed on calling of one of the following methods: LoadAssembly, LoadForm, LoadModule. Parameters of this property could be changed prior to .NET object loading if necessary.
Executing this example requires the TestForm.ppnform file in the root directory of disk C. This file contains the saved .NET form of the platform. The current repository contains a .NET assembly with the TestAssembly identifier.
Sub UserProc;
Var
MB: IMetabase;
NETAsm: IMetabaseObjectDescriptor;
Fs: IForeNETSerializer;
Fsl: IForeNETSerializerLoader;
Id: String;
Begin
MB := MetabaseClass.Active;
NETAsm := MB.ItemById("TestAssembly");
Fs := New ForeNETSerializer.Create;
Fsl := Fs.CreateLoaderFromFile("c:\TestForm.ppnform", MB);
Id := Fsl.CreateInfo.Id;
If MB.ItemByIdNamespace(Id, NETAsm.Key) <> Null Then
Fsl.CreateInfo.Id := MB.GenerateId(Id, NETAsm.Key);
Fsl.CreateInfo.Name := Fsl.CreateInfo.Name + "_Copy";
End If;
Fsl.Assembly := NETAsm.Bind As IForeNETAssembly;
Fsl.CreateInfo.Parent := NETAsm;
Fsl.LoadForm;
End Sub UserProc;
On executing this example the .NET form is loaded from the specified file. The .NET form is saved in the specified .NET assembly of repository. If the given .NET assembly contains an object having same identifier with the loaded .NET form, the identifier of .NET form will be changed before loading.
NOTE. If the identifier of .NET form is changed at loading, the name of the class corresponding to this .NET form should be modified to make the .NET form operative.
See also: