BindToAssembly(AssamblyName: String): IForeAssembly;
AssamblyName. The assembly, which structures should be accessed.
The BindToAssembly method provides access to assembly structures.
Set name of development environment system assembly (ABAC, Adhoc and others) or identifier of assembly/form/unit in repository as the AssamblyName parameter value. If repository assembly is implemented inside the container, then the following value is specified in the AssamblyName parameter: <container identifier>.<assembly identifier>.
Executing the example requires that repository contains an assembly with the ASSM_TEST identifier.
Add a link to the Fore, Metabase system assembly.
Sub UserProc;
Var
ForeService: IForeServices;
Runtime: IForeRuntime;
Assm: IForeAssembly;
FClass: IForeClass;
FSub: IForeSub;
i, j: Integer;
Begin
ForeService := MetabaseClass.Active As IForeServices;
Runtime := ForeService.GetRuntime;
//Load assembly
Assm := Runtime.BindToAssembly("ASSM_TEST");
//Get information about interfaces, classes, enumerations
j := Assm.ClassesCount - 1;
For i := 0 To j Do
FClass := Assm.ClassItem(i);
Select Case FClass.ClassType
Case ForeClassType.Class_: Debug.Write("Class: ");
Case ForeClassType.Interface_: Debug.Write("Interface: ");
Case ForeClassType.Enum_: Debug.Write("Enumeration: ");
End Select;
Debug.WriteLine(FClass.Name);
End For;
//Get information about procedures/functions implemented in global assembly namespace
j := Assm.SubsCount - 1;
For i := 0 To j Do
FSub := Assm.SubItem(i);
If FSub.IsResult Then
Debug.Write("Function: ");
Else
Debug.Write("Procedure: ");
End If;
Debug.WriteLine(FSub.Name);
End For;
End Sub UserProc;
On executing the example, the repository assembly with the specified identifier will be loaded to the execution environment. The list of structures implemented in the assembly will be displayed in the development environment console.
See also: