Custom Property Conditions

Hello all,

I have a question regarding the TreeWalker sample and UI automation in general.

Say, for example, I have a UI that contains several panes, with the automation ID's BrowsePane1, BrowsePane2, ..., etc, and I want to retrieve all of these. Assuming that I have an AutomationElement rootElement, I want to call rootElement.FindAll(TreeScope.Element | TreeScope.Descendants, condition), where my condition is such that I can retrieve all the elements that have an automation identifier that begins with "BrowsePane". Essentially, I want my condition to be thatAutomationElement.AutomationIdProperty.ToString().StartsWith("BrowsePane")evaluates to true.

Is there any way to create an object of (base)type System.Windows.Automation.Condition so that I can do this (e.g. something that takes a Boolean function as an argument) using the existing library, or will I have to create my own subclass to do this?

Thanks.

JLutz

[1180 byte] By [JLutz] at [2008-2-5]
# 1

Sorry, but at present there is no way to create custom property conditions.

PeterDonnelly-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Microsoft UI Automation...

Software Development for Windows Vista

Site Classified