IModule.ParentAssembly

Syntax

ParentAssembly: IMetabaseObjectDescriptor;

Description

The ParentAssembly property returns the parent assembly description.

Comments

If a unit or form are included in any assembly, the Standalone property returns False and it is possible to get parent assembly description in this property. If a unit or form are not included in any assembly, they implement temporary assembly. Its parameters are available in the Assembly property.

Example

Executing the example requires that the repository contains a unit with the TestModule identifier.

Sub Main;
Var
    MB: IMetabase;
    Module: IModule;
Begin
    MB := MetabaseClass.Active;
    Module := MB.ItemById("TestModule").Bind As IModule;
    If Not Module.Standalone Then
        Debug.WriteLine("Parent assembly: " + Module.ParentAssembly.Id);
        Debug.WriteLine("Parent assembly links: " + (Module.ParentAssembly.Bind As IAssembly).References);
    Else
        Debug.WriteLine("Unit is not included in any repository assembly");
        Debug.WriteLine("Unit links: " + Module.Assembly.References);
    End If;
End Sub Main;

After executing the example the development environment console displays information about unit: parent assembly existence and connected assemblies.

See also:

IModule