コード例 #1
0
        public List <MSAAUIItem> GetChildren(AccessibleUIItemType uiItemType)
        {
            List <MSAAUIItem> accUiItemList = new List <MSAAUIItem>();

            foreach (IAccessible accUIObject in MSAA.GetAccessibleChildren(_me))
            {
                MSAAUIItem accUIItem = new MSAAUIItem(accUIObject);

                if (accUIItem.Properties.Role == MSAARoles.GetRoleText(uiItemType))
                {
                    accUiItemList.Add(accUIItem);
                }
            }

            return(accUiItemList);
        }
コード例 #2
0
        public static List <MSAAUIItem> GetAllUIItemsOfType(AccessibleUIItemType uiItemType, bool ignoreInvisible)
        {
            List <MSAAUIItem> accUiItemList = new List <MSAAUIItem>();

            var accObjectList = new List <IAccessible>();

            MSAA.GetAccessibleObjectListByRole(_me, MSAARoles.GetRoleText(uiItemType), ref accObjectList, ignoreInvisible);

            foreach (IAccessible accUIObject in accObjectList)
            {
                MSAAUIItem accUIItem = new MSAAUIItem(accUIObject);

                if (accUIItem.Properties.Role == MSAARoles.GetRoleText(uiItemType))
                {
                    accUiItemList.Add(accUIItem);
                }
            }

            return(accUiItemList);
        }
コード例 #3
0
        public MSAAUIItem(IAccessible parentAccObject, Regex name, AccessibleUIItemType uiItemType, bool ignoreInvisible)
        {
            for (int searchCycleCount = 0; searchCycleCount < searchCycles; searchCycleCount++)
            {
                _me     = MSAA.GetObjectByNameAndRole(parentAccObject, name, MSAARoles.GetRoleText(uiItemType), ignoreInvisible);
                _parent = parentAccObject;

                if (_me == null || _me == default(IAccessible))
                {
                    Thread.Sleep(searchDuration);
                }
                else
                {
                    _propertySet = new MSAAPropertySet(_me);
                    break;
                }
            }

            _propertySet = new MSAAPropertySet(_me);
        }