示例#1
0
        public ITextRangeProvider RangeFromChild(IRawElementProviderSimple childElement)
        {
            if (!(childElement is ElementProxy))
            {
                throw new ArgumentException(SR.Get(SRID.TextProvider_InvalidChild, "childElement"));
            }

            return((ITextRangeProvider)ElementUtil.Invoke(_peer, new DispatcherOperationCallback(RangeFromChild), childElement));
        }
        public bool Compare(ITextRangeProvider range)
        {
            if (!(range is TextRangeProviderWrapper))
            {
                throw new ArgumentException(SR.Get(SRID.TextRangeProvider_InvalidRangeProvider, "range"));
            }

            return((bool)ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Compare), range));
        }
        public IRawElementProviderFragment GetFocus()
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                return(null);
            }
            return((IRawElementProviderFragment)ElementUtil.Invoke(peer, state => ((ElementProxy)state).InContextGetFocus(), this));
        }
        public void SetFocus()
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            ElementUtil.Invoke(peer, state => ((ElementProxy)state).InContextSetFocus(), this);
        }
        public int [] GetRuntimeId()
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            return((int [])ElementUtil.Invoke(peer, state => ((ElementProxy)state).InContextGetRuntimeId(), this));
        }
示例#6
0
        //------------------------------------------------------
        //
        //  Interface IRawElementProviderFragmentRoot
        //
        //------------	------------------------------------------

        #region Interface IRawElementProviderFragmentRoot
        // Implementation of the interface that exposes this
        // to UIAutomation.
        //
        // Interface IRawElementProviderFragmentRoot 'derives' from
        // IRawElementProviderSimple and IRawElementProviderFragment,
        // methods from those appear first below.
        //
        // Most of the interface methods on this interface need
        // to get onto the Visual's context before they can access it,
        // so use Dispatcher.Invoke to call a private method (in the
        // private methods section of this class) that does the real work.

        // IRawElementProviderSimple methods...

        public object GetPatternProvider(int pattern)
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            return(ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextGetPatternProvider), pattern));
        }
示例#7
0
        // IRawElementProviderFragmentRoot methods..
        public IRawElementProviderFragment ElementProviderFromPoint(double x, double y)
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                return(null);
            }
            return((IRawElementProviderFragment)ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextElementProviderFromPoint), new Point(x, y)));
        }
示例#8
0
        public IRawElementProviderFragment GetFocus()
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                return(null);
            }
            return((IRawElementProviderFragment)ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextGetFocus), null));
        }
示例#9
0
        public int [] GetRuntimeId()
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            return((int [])ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextGetRuntimeId), null));
        }
示例#10
0
        public void SetFocus()
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextSetFocus), null);
        }
示例#11
0
        // IRawElementProviderFragment methods...

        public IRawElementProviderFragment Navigate(NavigateDirection direction)
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                return(null);
            }
            return((IRawElementProviderFragment)ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextNavigate), direction));
        }
示例#12
0
        public object GetPropertyValue(int property)
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            return(ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextGetPropertyValue), property));
        }
示例#13
0
        public int CompareEndpoints(TextPatternRangeEndpoint endpoint, ITextRangeProvider targetRange, TextPatternRangeEndpoint targetEndpoint)
        {
            if (!(targetRange is TextRangeProviderWrapper))
            {
                throw new ArgumentException(SR.Get(SRID.TextRangeProvider_InvalidRangeProvider, "targetRange"));
            }

            object[] args = new object[] { endpoint, targetRange, targetEndpoint };
            return((int)ElementUtil.Invoke(_peer, new DispatcherOperationCallback(CompareEndpoints), args));
        }
示例#14
0
        //------------------------------------------------------
        //
        //  Interface IItemContainerProvider
        //
        //------------------------------------------------------

        #region Interface IItemContainerProvider

        public IRawElementProviderSimple FindItemByProperty(IRawElementProviderSimple startAfter, int propertyId, object value)
        {
            object [] args = new object[] { startAfter, propertyId, value };
            return((IRawElementProviderSimple)ElementUtil.Invoke(_peer, new DispatcherOperationCallback(FindItemByProperty), args));
        }
示例#15
0
 public void SetScrollPercent(double horizontalPercent, double verticalPercent)
 {
     ElementUtil.Invoke(_peer, new DispatcherOperationCallback(SetScrollPercent), new double [] { horizontalPercent, verticalPercent });
 }
示例#16
0
        //------------------------------------------------------
        //
        //  Interface IScrollProvider
        //
        //------------------------------------------------------

        #region Interface IScrollProvider

        public void Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount)
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Scroll), new ScrollAmount [] { horizontalAmount, verticalAmount });
        }
示例#17
0
        //------------------------------------------------------
        //
        //  Interface IValueProvider
        //
        //------------------------------------------------------

        #region Interface IValueProvider

        public void SetValue(string val)
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(SetValueInternal), val);
        }
示例#18
0
 public void Resize(double width, double height)
 {
     ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Resize), new double [] { width, height });
 }
 public IRawElementProviderSimple [] GetColumnHeaderItems()
 {
     return((IRawElementProviderSimple [])ElementUtil.Invoke(_peer, new DispatcherOperationCallback(GetColumnHeaderItems), null));
 }
示例#20
0
        //------------------------------------------------------
        //
        //  Interface IExpandCollapseProvider
        //
        //------------------------------------------------------

        #region Interface IExpandCollapseProvider

        public void Expand()
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Expand), null);
        }
示例#21
0
        //------------------------------------------------------
        //
        //  Interface IDockProvider
        //
        //------------------------------------------------------

        #region Interface IDockProvider

        public void SetDockPosition(DockPosition dockPosition)
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(SetDockPosition), dockPosition);
        }
        //------------------------------------------------------
        //
        //  Interface ISynchronizedInputProvider
        //
        //------------------------------------------------------

        #region Interface ISynchronizedInputProvider

        public void StartListening(SynchronizedInputType inputType)
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(StartListening), inputType);
        }
 public void Cancel()
 {
     ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Cancel), null);
 }
        //------------------------------------------------------
        //
        //  Interface IInvokeProvider
        //
        //------------------------------------------------------

        #region Interface IScrollItemProvider

        public void ScrollIntoView()
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(ScrollIntoView), null);
        }
示例#25
0
 public void Collapse()
 {
     ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Collapse), null);
 }
        //------------------------------------------------------
        //
        //  Interface IWindowProvider
        //
        //------------------------------------------------------

        #region Interface IWindowProvider

        public void SetVisualState(WindowVisualState state)
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(SetVisualState), state);
        }
示例#27
0
        //------------------------------------------------------
        //
        //  Interface IWindowProvider
        //
        //------------------------------------------------------

        #region Interface ITransformProvider


        public void Move(double x, double y)
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Move), new double [] { x, y });
        }
 public bool WaitForInputIdle(int milliseconds)
 {
     return((bool)ElementUtil.Invoke(_peer, new DispatcherOperationCallback(WaitForInputIdle), milliseconds));
 }
示例#29
0
 public void Rotate(double degrees)
 {
     ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Rotate), degrees);
 }
示例#30
0
 public int [] GetSupportedViews()
 {
     return((int [])ElementUtil.Invoke(_peer, new DispatcherOperationCallback(GetSupportedViews), null));
 }