Infrared Automation UI UltraWinTree Collapse

In Windows Forms, we use the Infragistics UltraWinTree management.

Purpose: collapse all tree elements using UI Automation (UIAutomationClient.dll).

See below for more information about user interface automation: https://msdn.microsoft.com/en-us/library/ms747327(v=vs.110).aspx

Below is the code.

 if (true == elementNode.TryGetCurrentPattern(InvokePattern.Pattern, out object patt))
    {
          invokePattern = patt as InvokePattern;
          invokePattern.Invoke()
    }

Problem: The last tree object does not collapse. When I see an element in Spy UI, false is displayed for the last property of the "InvokePatternAvailable" tree. For the last treeitem, only the Invoke Pattern is not available, for this reason it is higher if the condition is not satisfied.

My question is: Is this the right way to collapse the Infragistics object tree? Or is there an error in the Infragistics controls?

+6
source share

Source: https://habr.com/ru/post/1017205/


All Articles