Inheritance: ControlProviderTemplate
Exemplo n.º 1
0
        internal static IEnumerable <IUiElement> SearchByContainsTextViaWin32(
            IUiElement inputObject,
            ControlFromWin32Provider controlProvider)
        {
            var resultList =
                new List <IUiElement>();

            foreach (IUiElement elementToChoose in controlProvider.GetElements(null))
            {
                if (null != controlProvider.SearchData.ControlType && 0 < controlProvider.SearchData.ControlType.Length)
                {
                    foreach (string controlTypeName in controlProvider.SearchData.ControlType)
                    {
                        // 20140312
                        // if (!String.Equals(elementToChoose.Current.ControlType.ProgrammaticName.Substring(12), controlTypeName, StringComparison.CurrentCultureIgnoreCase)) {
                        if (!String.Equals(elementToChoose.GetCurrent().ControlType.ProgrammaticName.Substring(12), controlTypeName, StringComparison.CurrentCultureIgnoreCase))
                        {
                            continue;
                        }
                        else
                        {
                            resultList.Add(elementToChoose);
                            break;
                        }
                    }
                }
                else
                {
                    resultList.Add(elementToChoose);
                }
            }

            return(resultList);
        }
Exemplo n.º 2
0
 internal static IEnumerable<IUiElement> SearchByContainsTextViaWin32(
     IUiElement inputObject,
     ControlFromWin32Provider controlProvider)
 {
     var resultList =
         new List<IUiElement>();
     
     foreach (IUiElement elementToChoose in controlProvider.GetElements(null)) {
         
         if (null != controlProvider.SearchData.ControlType && 0 < controlProvider.SearchData.ControlType.Length) {
             
             foreach (string controlTypeName in controlProvider.SearchData.ControlType) {
                 
                 // 20140312
                 // if (!String.Equals(elementToChoose.Current.ControlType.ProgrammaticName.Substring(12), controlTypeName, StringComparison.CurrentCultureIgnoreCase)) {
                 if (!String.Equals(elementToChoose.GetCurrent().ControlType.ProgrammaticName.Substring(12), controlTypeName, StringComparison.CurrentCultureIgnoreCase)) {
                     continue;
                 } else {
                     resultList.Add(elementToChoose);
                     break;
                 }
                 
             }
             
         } else {
             resultList.Add(elementToChoose);
         }
     }
     
     return resultList;
 }
Exemplo n.º 3
0
 public static List<IUiElement> Win32Gateway_GetElements_NullControlSearcherDataInput(
     IUiElement rootElement,
     IUiElement[] elements,
     IEnumerable<int> handles,
     string searchString)
 {
     var controlProvider = new ControlFromWin32Provider();
     var controlSearcherData = new ControlSearcherTemplateData {
         ContainsText = searchString,
         Name = searchString,
         Win32 = true,
         InputObject = new IUiElement[] { rootElement }
     };
     controlProvider.SearchData = controlSearcherData;
     
     var handleCollector = FakeFactory.GetHandleCollector(rootElement, handles, elements);
     controlProvider.HandleCollector = handleCollector;
     
     List<IUiElement> resultList =
         controlProvider.GetElements(
             null);
     
     return resultList;
 }