LightWeight: Boolean;
The LightWeight property determines whether query for getting child elements of hierarchy level is executed.
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.
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.
See also: