Пример #1
0
        /// <inheritdoc />
        public override SHAutomationElement FindIndexed(TreeScope treeScope, int index, ConditionBase condition)
        {
            var nativeFoundElements = NativeElement.FindAll((UIA.TreeScope)treeScope, ConditionConverter.ToNative(Automation, condition));
            var nativeElement       = nativeFoundElements.GetElement(index);

            return(nativeElement == null ? null :SHAutomationElementConverter.NativeToManaged(Automation, nativeElement));
        }
Пример #2
0
        public override ITextRange RangeFromChild(SHAutomationElement child)
        {
            var nativeChild = SHAutomationElementConverter.ToNative(child);
            var nativeRange = Com.Call(() => NativePattern.RangeFromChild(nativeChild));

            return(TextRangeConverter.NativeToManaged((UIA3Automation)FrameworkAutomationElement.Automation, nativeRange));
        }
Пример #3
0
        /// <inheritdoc />
        public override SHAutomationElement FindFirstWithOptions(TreeScope treeScope, ConditionBase condition,
                                                                 TreeTraversalOption traversalOptions, SHAutomationElement root)
        {
            var nativeFoundElement = NativeElement7.FindFirstWithOptions((UIA.TreeScope)treeScope, ConditionConverter.ToNative(Automation, condition), (UIA.TreeTraversalOptions)traversalOptions, SHAutomationElementConverter.ToNative(root));

            return(SHAutomationElementConverter.NativeToManaged(Automation, nativeFoundElement));
        }
Пример #4
0
        /// <inheritdoc />
        public SHAutomationElement GetPreviousSibling(SHAutomationElement element)
        {
            var child =
                NativeTreeWalker.GetPreviousSiblingElement(SHAutomationElementConverter.ToNative(element));

            return(Automation.WrapNativeElement(child));
        }
Пример #5
0
        public ITextRange RangeFromAnnotation(SHAutomationElement annotation)
        {
            var nativeInputElement = SHAutomationElementConverter.ToNative(annotation);
            var nativeElement      = Com.Call(() => ExtendedNativePattern.RangeFromAnnotation(nativeInputElement));

            return(TextRangeConverter.NativeToManaged((UIA3Automation)FrameworkAutomationElement.Automation, nativeElement));
        }
Пример #6
0
        /// <inheritdoc />
        public SHAutomationElement GetLastChild(SHAutomationElement element)
        {
            var child =
                NativeTreeWalker.GetLastChildElement(SHAutomationElementConverter.ToNative(element));

            return(Automation.WrapNativeElement(child));
        }
Пример #7
0
        /// <inheritdoc />
        public SHAutomationElement GetParent(SHAutomationElement element)
        {
            var parent =
                NativeTreeWalker.GetParentElement(SHAutomationElementConverter.ToNative(element));

            return(Automation.WrapNativeElement(parent));
        }
        public SHAutomationElement FindItemByProperty(SHAutomationElement startAfter, PropertyId property, object value)
        {
            var foundNativeElement = Com.Call(() =>
                                              NativePattern.FindItemByProperty(
                                                  SHAutomationElementConverter.ToNative(startAfter),
                                                  property?.Id ?? 0, ValueConverter.ToNative(value)));

            return(SHAutomationElementConverter.NativeToManaged((UIA3Automation)FrameworkAutomationElement.Automation, foundNativeElement));
        }
Пример #9
0
        /// <inheritdoc />
        public override SHAutomationElement FindFirst(TreeScope treeScope, ConditionBase condition)
        {
            var nativeFoundElement = NativeElement.FindFirst((UIA.TreeScope)treeScope, ConditionConverter.ToNative(Automation, condition));

            return(SHAutomationElementConverter.NativeToManaged(Automation, nativeFoundElement));
        }
Пример #10
0
        /// <inheritdoc />
        public override SHAutomationElement[] FindAll(TreeScope treeScope, ConditionBase condition)
        {
            var nativeFoundElements = NativeElement.FindAll((UIA.TreeScope)treeScope, ConditionConverter.ToNative(Automation, condition));

            return(SHAutomationElementConverter.NativeArrayToManaged(Automation, nativeFoundElements));
        }
Пример #11
0
        public SHAutomationElement GetEnclosingElement()
        {
            var nativeElement = Com.Call(() => NativeRange.GetEnclosingElement());

            return(SHAutomationElementConverter.NativeToManaged(Automation, nativeElement));
        }
Пример #12
0
        public SHAutomationElement[] GetChildren()
        {
            var nativeChildren = Com.Call(() => NativeRange.GetChildren());

            return(SHAutomationElementConverter.NativeArrayToManaged(Automation, nativeChildren));
        }
Пример #13
0
        public override SHAutomationElement GetItem(int row, int column)
        {
            var nativeItem = Com.Call(() => NativePattern.GetItem(row, column));

            return(SHAutomationElementConverter.NativeToManaged((UIA3Automation)FrameworkAutomationElement.Automation, nativeItem));
        }
Пример #14
0
        public SHAutomationElement GetItemByName(string name)
        {
            var nativeElement = Com.Call(() => NativePattern.GetItemByName(name));

            return(SHAutomationElementConverter.NativeToManaged((UIA3Automation)FrameworkAutomationElement.Automation, nativeElement));
        }