Assembly: IForeNETAssembly;
The Assembly property determines repository .NET assembly, where the loaded .NET unit/.NET form is saved.
Specification of .NET assembly is required for correct configuration of links to the loaded .NET unit/.NET form. The .NET assembly specified in this property (or one of child folders of this assembly), should also be specified in the Parent property in parameters CreateInfo.
Executing this example requires the TestForm.ppnform file in the root directory of disk C. The file contains the saved .NET form of Foresight Analytics 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: