Example #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));
        }
Example #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));
        }
Example #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)));
        }
Example #8
0
        public IRawElementProviderFragment GetFocus()
        {
            AutomationPeer peer = Peer;

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

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

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextSetFocus), null);
        }
Example #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));
        }
Example #12
0
        public object GetPropertyValue(int property)
        {
            AutomationPeer peer = Peer;

            if (peer == null)
            {
                throw new ElementNotAvailableException();
            }
            return(ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextGetPropertyValue), property));
        }
        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));
        }
Example #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));
        }
Example #15
0
 public void SetScrollPercent(double horizontalPercent, double verticalPercent)
 {
     ElementUtil.Invoke(_peer, new DispatcherOperationCallback(SetScrollPercent), new double [] { horizontalPercent, verticalPercent });
 }
Example #16
0
        //------------------------------------------------------
        //
        //  Interface IScrollProvider
        //
        //------------------------------------------------------

        #region Interface IScrollProvider

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

        #region Interface IValueProvider

        public void SetValue(string val)
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(SetValueInternal), val);
        }
 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));
 }
Example #20
0
        //------------------------------------------------------
        //
        //  Interface IExpandCollapseProvider
        //
        //------------------------------------------------------

        #region Interface IExpandCollapseProvider

        public void Expand()
        {
            ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Expand), null);
        }
Example #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);
        }
Example #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);
        }
        //------------------------------------------------------
        //
        //  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));
 }
 public void Rotate(double degrees)
 {
     ElementUtil.Invoke(_peer, new DispatcherOperationCallback(Rotate), degrees);
 }
Example #30
0
 public int [] GetSupportedViews()
 {
     return((int [])ElementUtil.Invoke(_peer, new DispatcherOperationCallback(GetSupportedViews), null));
 }