UIAutomation.Wizard.IsStepActive C# (CSharp) Method

IsStepActive() private method

private IsStepActive ( WizardStep step, IUiEltCollection elements ) : bool
step WizardStep
elements IUiEltCollection
return bool
        internal bool IsStepActive(WizardStep step, IUiEltCollection elements)
        {
            bool result = false;
            
            if (null == step) return result;
            if (null == step.SearchCriteria || 0 == step.SearchCriteria.Count()) return result;
            var searchCriteria = step.SearchCriteria.Where(hashtable => null != hashtable);
            if (null == searchCriteria || 0 == searchCriteria.Count()) return result;
            if (null == elements || 0 == elements.Count) return result;
            
            if (searchCriteria.All(criterion =>   
                                   elements.ToArray().Any(elt => ControlSearcher.TestControlWithAllSearchCriteria(new Hashtable[] { criterion }, elt))
                                  )) {
                result = true;
            }
            
            return result;
        }
        

Usage Example

Example #1
0
 public static bool GetResult_IsStepActive(Hashtable[] searchCriteria, IUiEltCollection elements)
 {
     var step = new WizardStep("stepName", 1) {
         Description = "description",
         SearchCriteria = searchCriteria
     };
     
     var wizard = new Wizard("wizardName");
     
     return wizard.IsStepActive(step, elements);
 }