automation实现inspect元素

This commit is contained in:
fofolee
2025-01-15 01:33:28 +08:00
parent 021cce5947
commit a3dc6479f2
11 changed files with 933 additions and 263 deletions

9
automation.cs Normal file
View File

@@ -0,0 +1,9 @@
// 如果指定了过滤条件,创建一个组合条件
if (!string.IsNullOrEmpty(filter))
{
searchCondition = new OrCondition(
new PropertyCondition(AutomationElement.NameProperty, filter, PropertyConditionFlags.IgnoreCase),
new PropertyCondition(AutomationElement.ClassNameProperty, filter, PropertyConditionFlags.IgnoreCase),
new PropertyCondition(AutomationElement.AutomationIdProperty, filter, PropertyConditionFlags.IgnoreCase)
);
}