IMetaHierarchyLevel.LightWeight

Fore Syntax

LightWeight: Boolean;

Fore.NET Syntax

LightWeight: boolean;

Description

The LightWeight property determines whether query for getting child elements of hierarchy level is executed.

Comments

The property is not available for leaf levels of hierarchy and for composite dictionaries.

If LightWeight = True the query on getting child elements of hierarchy level is not executed, the Count property returns -2 for hierarchy element.

Fore Example

Executing the example requires a form that includes the MetaAttributesTreeList component with the MetaAttributesTreeList1 identifier and the button with the Button1 identifier. MetaAttributesTreeList must display data of any dictionary. Add a link to the Rds system assembly.

Example is a handler of the OnClick event for a button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Dict: IMetaDictionary;
    i: Integer;
    Hierarchy: IMetaHierarchy;
    HLevels: IMetaHierarchyLevels;
    HLev: IMetaHierarchyLevel;
Begin
    Dict := MetaAttributesTreeList1.Dictionary;
    If Not Dict.IsCompound Then
        Hierarchy := Dict.DefaultHierarchy;
        HLevels := Hierarchy.Levels;
        For i := 0 To HLevels.Count - 1 Do
            HLev := HLevels.Item(i);
            Debug.WriteLine(Level  + i.ToString +  :  + HLev.Name);
            If HLev.LightWeight Then
                Debug.WriteLine(  Dynamic data load is used);
            Else
                Debug.WriteLine(  Dynamic data load is not used);
            End If;
        End For;
    End If;
End Sub Button1OnClick;

After executing the example information about way of loading dictionary elements shown in the MetaAttributesTreeList1 component is displayed in the console window.

Fore.NET Example

Executing the example requires a form that includes the MetaAttributesTreeListNet component with the MetaAttributesTreeListNet1 identifier and the button with the button1 identifier. MetaAttributesTreeListNet must display data of any dictionary.

Example is a handler of the OnClick event for a button.

Imports Prognoz.Platform.Interop.Rds;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var 
    Dict: IMetaDictionary;
    i: Integer;
    Hierarchy: IMetaHierarchy;
    HLevels: IMetaHierarchyLevels;
    HLev: IMetaHierarchyLevel;
Begin
    Dict := MetaAttributesTreeListNet1.Dictionary;
    If Not Dict.IsCompound Then
        Hierarchy := Dict.DefaultHierarchy;
        HLevels := Hierarchy.Levels;
        For i := 0 To HLevels.Count - 1 Do
            HLev := HLevels.Item[i];
            System.Diagnostics.Debug.WriteLine(Level  + i.ToString() +  :  + HLev.Name);
            If HLev.LightWeight Then
                System.Diagnostics.Debug.WriteLine(  Dynamic data load is used);
            Else
                System.Diagnostics.Debug.WriteLine(  Dynamic data load is not used);
            End If;
        End For;
    End If;
End Sub;

After executing the example information about way of loading dictionary elements shown in the MetaAttributesTreeList1 component is displayed in the console window.

See also:

IMetaHierarchyLevel