AllChildrenCount(Element: Integer): Integer;
AllChildrenCount[Element: UInteger]: Integer;
Element - dictionary element index.
The AllChildrenCount property returns total number of children for the element with the Element index.
This property returns the total number of child elements at all levels below the Element element. To get the number of direct child elements positioned one level below the element, use the ChildrenCount property.
Executing the example requires a form, a button named Button1 positioned on this form, the UiDimension component named UiDimension1, and the DimensionTree component named DimensionTree1. A repository dictionary is linked to UiDimension1. UiDimension1 is used as the data source for DimensionTree1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Elems: IDimElements;
Begin
If DimensionTree1.FocusedElement <> -1 Then
Elems := UiDimension1.DimInstance.Elements;
Debug.WriteLine(Elems.AllChildrenCount(DimensionTree1.FocusedElement));
Debug.WriteLine(Elems.ChildrenCount(DimensionTree1.FocusedElement));
End If;
End Sub Button1OnClick;
After executing the example on clicking the button the development environment console displays total number of child elements and the number of direct child elements for the element focused in the DimensionTree1 component.
Executing the example requires a .NET form, a button named Button1 positioned on this form, the UiDimensionNet component named UiDimensionNet1, and the DimensionTreeNet component named DimensionTreeNet1. A repository dictionary is linked to UiDimensionNet1. «UiDimensionNet1 is used as the data source for DimensionTreeNet1.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Elems: IDimElements;
Begin
If dimensionTreeNet1.FocusedElement <> -1 Then
Elems := uiDimensionNet1.DimInstance.Elements;
Self.Text := Elems.AllChildrenCount[DimensionTreeNet1.FocusedElement].ToString();
Self.Text := Self.Text + " " + Elems.ChildrenCount[DimensionTreeNet1.FocusedElement].ToString();
End If;
End Sub;
After executing the example on clicking the button the form title displays the total number of child elements and the number of direct child elements for the element focused in the DimensionTreeNet1 component.
See also: