IForeNETAssembly.LoadExternal

Syntax

LoadExternal(FileName: String);

Parameters

FileName is a file of external assembly, that should be loaded into repository .NET assembly.

Description

The LoadExternal method loads the specified file of external assembly into repository .NET assembly.

NOTE. External assembly could be loaded only into .NET assembly that does not have any child object.

Example

Executing this example requires file UserFunc.dll, received as a result of compilation of any assembly, to be present in the root of disk C.

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    Assembly: IMetabaseObject;
    NETAssembly: IForeNETAssembly;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_NETASSEMBLY;
    CrInfo.Name := "UserFunc";
    CrInfo.Id := "ExtAssembly";
    CrInfo.Parent := MB.Root;
    Assembly := MB.CreateObject(CrInfo).Edit;
    Assembly.Save;
    NETAssembly := Assembly As IForeNETAssembly;
    NETAssembly.LoadExternal("c:\UserFunc.dll");
    NETAssembly.IsExternal := True;
    Assembly.Save;
End Sub UserProc;

After executing this example a new .NET assembly is created in the root of repository. The external assembly, contained in the file UserFunc.dll, is loaded into this assembly.

See also:

IForeNETAssembly