File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
src/TestStack.White/UIItems/Finders Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -63,5 +63,11 @@ public static SearchCondition CreateForNativeProperty(AutomationProperty automat
6363 var automationElementProperty = new AutomationElementProperty ( value , automationProperty . ProgrammaticName , automationProperty ) ;
6464 return new SimpleSearchCondition ( automationElement => automationElement . GetCurrentPropertyValue ( automationProperty ) , automationElementProperty ) ;
6565 }
66+
67+ public static SearchCondition CreateForNativeProperty ( AutomationProperty automationProperty , object value )
68+ {
69+ var automationElementProperty = new AutomationElementProperty ( value , automationProperty . ProgrammaticName , automationProperty ) ;
70+ return new SimpleSearchCondition ( automationElement => automationElement . GetCurrentPropertyValue ( automationProperty ) , automationElementProperty ) ;
71+ }
6672 }
6773}
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ public static SearchCriteria ByNativeProperty(AutomationProperty automationPrope
9292 return new SearchCriteria ( SearchConditionFactory . CreateForNativeProperty ( automationProperty , value ) ) ;
9393 }
9494
95+ public static SearchCriteria ByNativeProperty ( AutomationProperty automationProperty , object value )
96+ {
97+ return new SearchCriteria ( SearchConditionFactory . CreateForNativeProperty ( automationProperty , value ) ) ;
98+ }
99+
95100 public static SearchCriteria ByControlType ( Type testControlType , WindowsFramework framework )
96101 {
97102 var searchCriteria = new SearchCriteria ( SearchConditionFactory . CreateForControlType ( testControlType , framework ) ) ;
@@ -201,6 +206,12 @@ public virtual SearchCriteria AndNativeProperty(AutomationProperty automationPro
201206 return this ;
202207 }
203208
209+ public virtual SearchCriteria AndNativeProperty ( AutomationProperty automationProperty , object value )
210+ {
211+ conditions . Insert ( 0 , SearchConditionFactory . CreateForNativeProperty ( automationProperty , value ) ) ;
212+ return this ;
213+ }
214+
204215 public virtual List < AutomationElement > Filter ( List < AutomationElement > automationElements )
205216 {
206217 return conditions . Filter ( automationElements ) ;
You can’t perform that action at this time.
0 commit comments