示例#1
0
        public TextRange FindAttribute(TextAttributeId attribute, object value, bool backward)
        {
            var nativeValue     = NativeValueConverter.ToNative(value);
            var nativeTextRange = ComCallWrapper.Call(() => NativeRange.FindAttribute(attribute.Id, nativeValue, backward.ToInt()));

            return(NativeValueConverter.NativeToManaged(Automation, nativeTextRange));
        }
示例#2
0
        public Element FindItemByProperty(Element startAfter, PropertyId property, object value)
        {
            var foundNativeElement = ComCallWrapper.Call(() =>
                                                         NativePattern.FindItemByProperty(
                                                             startAfter == null ? null : startAfter.NativeElement,
                                                             property == null ? 0 : property.Id, NativeValueConverter.ToNative(value)));

            return(ToAutomationElement(foundNativeElement));
        }