Пример #1
0
        internal static Element GetElement(Accessible accessible, bool create)
        {
            if (accessible == null)
            {
                return(null);
            }
            // We expose the children of Applications as top-level,
            // to be more like UIA
            if (accessible.Role == Role.Application)
            {
                return(null);
            }
            if (elements.ContainsKey(accessible))
            {
                return(elements [accessible]);
            }
            if (!create)
            {
                return(null);
            }
            Element element;

            if (IsTable(accessible))
            {
                element = new TableElement(accessible);
            }
            else if (IsTableHeaderItem(accessible))
            {
                element = new TableHeaderItemElement(accessible);
            }
            else if (IsTreeItem(accessible))
            {
                element = new TreeItemElement(accessible);
            }
            else
            {
                element = new Element(accessible);
            }
            return(element);
        }
Пример #2
0
		internal static Element GetElement (Accessible accessible, bool create)
		{
			if (accessible == null)
				return null;
			// We expose the children of Applications as top-level,
			// to be more like UIA
			if (accessible.Role == Role.Application)
				return null;
			if (elements.ContainsKey (accessible))
			return elements [accessible];
			if (!create)
				return null;
			Element element;
			if (IsTable (accessible))
				element = new TableElement (accessible);
			else if (IsTableHeaderItem (accessible))
				element = new TableHeaderItemElement (accessible);
			else if (IsTreeItem (accessible))
				element = new TreeItemElement (accessible);
			else
				element = new Element (accessible);
			return element;
		}