IsLeafUnloaded(Element: Integer): Boolean;
IsLeafUnloaded(Element: uinteger): boolean;
Element. Index of dictionary element.
The IsLeafUnloaded method returns attribute that dictionary element is not loaded.
The method returns True, if element is not loaded and False, if it is loaded.
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;
LastItemIndex: Integer;
Begin
Dim := UiDimension1.DimInstance As IDynamicInstance;
// Get index of the last dictionary element
LastItemIndex := Dim.CreateDimElementArray.Count - 1;
If Dim.IsLeafUnloaded(LastItemIndex) Then
Debug.WriteLine("Index of the last element owner: " +
Dim.OwnerOfUnloadedLeaf(LastItemIndex).ToString);
Else
Debug.WriteLine("Index of the last element owner: " +
Dim.OwnerOfLoadedNode(LastItemIndex).ToString);
End If;
End Sub Button1OnClick;
On clicking the Button1 button the console displays index of the element which is a parent towards the last element.
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;
LastItemIndex: Integer;
Begin
Dim := uiDimensionNet1.DimInstance As IDynamicInstance;
// Get index of the last dictionary element
LastItemIndex := Dim.CreateDimElementArray().Count - 1;
If Dim.IsLeafUnloaded(LastItemIndex As uinteger) Then
System.Diagnostics.Debug.WriteLine("Index of the last element owner: " +
Dim.OwnerOfUnloadedLeaf[LastItemIndex]);
Else
System.Diagnostics.Debug.WriteLine("Index of the last element owner: " +
Dim.OwnerOfLoadedNode[LastItemIndex]);
End If;
End Sub;
See also: