IDynamicInstance.LoadedChildrenCount

Fore Syntax

LoadedChildrenCount(Element: Integer): Integer;

Fore.NET Syntax

LoadedChildrenCount[Element: uinteger]: integer;

Parameters

Element. Index of dictionary element.

Description

The LoadedChildrenCount property returns number of loaded child elements of the specified dictionary element.

Comments

To get attribute whether there are loaded child elements of selected dictionary element, use the IDynamicInstance.HasLoadedChildren method.

Fore Example

Executing the example requires a form containing the DimensionTree component with the DimensionTree1 identifier, the UiDimension component with the UiDimension1 identifier and the Button component with the Button1 identifier. Determine the UiDimension1 component as data source for the DimensionTree1 component. Data source for the UiDimension1 component must be MDM table dictionary with set dynamic loading of elements.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Dim: IDynamicInstance;
Begin
    Dim := UiDimension1.DimInstance As IDynamicInstance;
    // Display number of loaded elements
    If Dim.HasLoadedChildren(0Then
        Debug.WriteLine("Number of loaded child elements of the first element: " + 
            Dim.LoadedChildrenCount(0).ToString);
    End If;
    Debug.WriteLine("Total of loaded elements: " + Dim.LoadedCount.ToString);
    // Display number of unloaded elements
    If Dim.HasLeavesAllowedToUnload(0Then
        Debug.WriteLine("Number of unloaded child elements of the first element: " + 
            Dim.UnloadedLeavesCount(0).ToString);
    End If;
    Debug.WriteLine("Total of unloaded elements: " + Dim.UnloadedLeavesTotalCount.ToString);
End Sub Button1OnClick;

On clicking the Button1 button the console displays:

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Dimensions;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Dim: IDynamicInstance;
Begin
    Dim := uiDimensionNet1.DimInstance As IDynamicInstance;
    // Display number of loaded elements
    If Dim.HasLoadedChildren(0Then
        System.Diagnostics.Debug.WriteLine("Number of loaded child elements of the first element: " + 
            Dim.LoadedChildrenCount[0]);
    End If;
    System.Diagnostics.Debug.WriteLine("Total of loaded elements: " + Dim.LoadedCount);
    // Display number of unloaded elements
    If Dim.HasLeavesAllowedToUnload(0Then
        System.Diagnostics.Debug.WriteLine("Number of unloaded child elements of the first element: " + 
            Dim.UnloadedLeavesCount[0]);
    End If;
    System.Diagnostics.Debug.WriteLine("Total of unloaded elements: " + Dim.UnloadedLeavesTotalCount);
End Sub;

See also:

IDynamicInstance