UIAutomation.ExtensionMethodsElement.IsMatchWildcardPattern C# (CSharp) Method

IsMatchWildcardPattern() static private method

static private IsMatchWildcardPattern ( this elementInput, IList resultCollection, WildcardPattern wcPattern, string dataToCheck ) : bool
elementInput this
resultCollection IList
wcPattern WildcardPattern
dataToCheck string
return bool
        internal static bool IsMatchWildcardPattern(
            this IUiElement elementInput,
            IList resultCollection,
            WildcardPattern wcPattern,
            string dataToCheck)
        {
            bool result = false;
            
            // 20140314
            // was an experiment
            // resultCollection = resultCollection ?? new List<IUiElement>();
            
            if (string.IsNullOrEmpty(dataToCheck)) {
                return result;
            }
            
            if (!wcPattern.IsMatch(dataToCheck)) return result;
            
            result = true;
            resultCollection.Add(elementInput);
            return result;
        }