Automation.UI.Tree.StringPropertyCondition.IsMatch C# (CSharp) Method

IsMatch() public method

Check if the specified automation element meets this condition's requirements.
public IsMatch ( AutomationElement element ) : bool
element System.Windows.Automation.AutomationElement The element to check.
return bool
        public bool IsMatch(AutomationElement element)
        {
            var actualObj = element.GetCurrentPropertyValue(Property);
            // If the element's current property value is null or not a string object, return false.
            if (actualObj == null || !(actualObj is string))
                return false;
            // Otherwise cast to strings...
            var actual = (string) actualObj;
            var expected = (string) Value;
            // ... and compare them.
            return Matcher.IsMatch(actual, expected);
        }
StringPropertyCondition