コード例 #1
0
        /// <remarks>from another grid</remarks>
        public void Navigate(NavigateDirection direction, int elementLineIndex)
        {
            //Console.WriteLine("Navigating to {0} with line index {1}", direction, elementLineIndex);
            int nextElementIndex;

            switch (direction)
            {
            case NavigateDirection.Left:
                nextElementIndex = elementLineIndex * 3 + 2;
                break;

            case NavigateDirection.Right:
                nextElementIndex = elementLineIndex * 3;
                break;

            case NavigateDirection.Up:
                nextElementIndex = 6 + elementLineIndex;
                break;

            case NavigateDirection.Down:
                nextElementIndex = elementLineIndex;
                break;

            default: throw new NotImplementedException();
            }

            //Console.WriteLine("Next element index: {0}", nextElementIndex);
            var elementNavigation = this.elementNavigations[nextElementIndex];

            elementNavigation.Navigate();
            this.elementIndex = nextElementIndex;
        }
コード例 #2
0
        /// <summary>
        /// check whether next element is within current grid.
        /// </summary>
        /// <remarks>from self</remarks>
        public bool CanNavigate(NavigateDirection direction)
        {
            var elementIndex = this.elementIndex;

            if (elementIndex == 4)
            {
                return(true);
            }

            switch (direction)
            {
            case NavigateDirection.Left:
                return(elementIndex % 3 != 0);

            case NavigateDirection.Right:
                return(elementIndex % 3 != 2);

            case NavigateDirection.Up:
                return(elementIndex / 3 != 0);

            case NavigateDirection.Down:
                return(elementIndex / 3 != 2);

            default: throw new NotImplementedException();
            }
        }
コード例 #3
0
        // </Snippet101>

        // <Snippet103>
        /// <summary>
        /// Navigate to adjacent elements in the automation tree.
        /// </summary>
        /// <param name="direction">Direction to navigate.</param>
        /// <returns>The element in that direction, or null.</returns>
        /// <remarks>
        /// parentControl is the provider for the list box.
        /// parentItems is the collection of list item providers.
        /// </remarks>
        public IRawElementProviderFragment Navigate(NavigateDirection direction)
        {
            int myIndex = parentItems.IndexOf(this);

            if (direction == NavigateDirection.Parent)
            {
                return((IRawElementProviderFragment)parentControl);
            }
            else if (direction == NavigateDirection.NextSibling)
            {
                if (myIndex < parentItems.Count - 1)
                {
                    return((IRawElementProviderFragment)parentItems[myIndex + 1]);
                }
                else
                {
                    return(null);
                }
            }
            else if (direction == NavigateDirection.PreviousSibling)
            {
                if (myIndex > 0)
                {
                    return((IRawElementProviderFragment)parentItems[myIndex - 1]);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
        public IRawElementProviderFragment Navigate(NavigateDirection direction)
        {
            // The GardenThings have no child UIA elements.

            if (direction == NavigateDirection.Parent)
            {
                return(this.parent);
            }
            else if (direction == NavigateDirection.PreviousSibling)
            {
                if (this.subItemIndex > 0)
                {
                    return(this.parent.GardenThings[this.subItemIndex - 1]);
                }
            }
            else if (direction == NavigateDirection.NextSibling)
            {
                if (this.subItemIndex < this.parent.GardenThings.Count - 1)
                {
                    return(this.parent.GardenThings[this.subItemIndex + 1]);
                }
            }

            return(null);
        }
コード例 #5
0
        public void Navigate(NavigateDirection direction)
        {
            var currentGridIndex = this.currentGridIndex;
            //Console.WriteLine("Current Grid Index: {0}", currentGridIndex);
            var currentGridNavigation = gridNavigations[currentGridIndex];

            //Console.WriteLine("Navigating to {0} test", direction, currentGridIndex);
            if (currentGridNavigation.CanNavigate(direction))
            {
                //Console.WriteLine("Passed");
                currentGridNavigation.Navigate(direction);
            }
            else
            {
                var currentElementIndex = currentGridNavigation.CurrentElementIndex;

                //Console.WriteLine("Failed");
                currentGridNavigation.Leave();

                var gridIndex        = currentGridIndex;
                var elementLineIndex = getElementLineIndex(currentElementIndex, direction);

                //gridIndex -> nextGirdIndex, elementLineIndex -> nextElementLineIndex
                getNextPosition81(ref gridIndex, ref elementLineIndex, direction);

                var nextGridNavigation = gridNavigations[gridIndex];
                //Console.WriteLine("Navigating to grid {0}", gridIndex);
                nextGridNavigation.Navigate(direction, elementLineIndex);

                this.currentGridIndex = gridIndex;
            }
        }
コード例 #6
0
        public static void MoveTrackBall(ChartTrackBallBehavior behav, NavigateDirection direction)
        {
            var    chart            = (RadCartesianChart)behav.Chart;
            object currentXCategory = null;

            if (chart.PlotAreaClip.X <= behav.Position.X && behav.Position.X <= chart.PlotAreaClip.Right)
            {
                currentXCategory = chart.ConvertPointToData(behav.Position).FirstValue;
            }

            Func <int, int> next = GetPositionXFunction(direction);
            object          adjacentXCategory = null;
            int             startX            = GetCoercedPositionX(behav);

            for (int x = startX; chart.PlotAreaClip.X <= x && x <= chart.PlotAreaClip.Right; x = next(x))
            {
                DataTuple tuple = chart.ConvertPointToData(new Point(x, 0));
                if (!object.Equals(currentXCategory, tuple.FirstValue))
                {
                    adjacentXCategory = tuple.FirstValue;
                    break;
                }
            }

            var adjacentPosition = chart.ConvertDataToPoint(new DataTuple(adjacentXCategory, null));

            adjacentPosition.Y = behav.Chart.ActualHeight / 2;

            behav.Position = adjacentPosition;
        }
コード例 #7
0
ファイル: ParentNavigation.cs プロジェクト: mono/uia2atk
		public override IRawElementProviderFragment Navigate (NavigateDirection direction) 
		{
			if (direction == NavigateDirection.Parent) {
				// TODO: Review this
				// "Fragment roots do not enable navigation to
				// a parent or siblings; navigation among fragment
				// roots is handled by the default window providers."
				// Source: http://msdn.microsoft.com/en-us/library/system.windows.automation.provider.irawelementproviderfragment.navigate.aspx
//				if (Provider is FragmentRootControlProvider)
//					return Provider.FragmentRoot;
				if (parentNavigation == null)
					return Provider.FragmentRoot;
				else
					return parentNavigation.Provider;
			}
			else if (direction == NavigateDirection.FirstChild)
				return chain.First == null ? null : chain.First.Value.Provider;
			else if (direction == NavigateDirection.LastChild)
				return chain.Last == null ? null : chain.Last.Value.Provider;
			else if (direction == NavigateDirection.NextSibling && parentNavigation != null)
				return parentNavigation.GetNextExplicitSiblingProvider (this);
			else if (direction == NavigateDirection.PreviousSibling && parentNavigation != null) 
				return parentNavigation.GetPreviousExplicitSiblingProvider (this);			
			else
				return null;
		}
コード例 #8
0
        public static void MoveTrackBall(ChartTrackBallBehavior behav, NavigateDirection direction)
        {
            var chart = (RadCartesianChart)behav.Chart;
            object currentXCategory = null;
            if (chart.PlotAreaClip.X <= behav.Position.X && behav.Position.X <= chart.PlotAreaClip.Right)
            {
                currentXCategory = chart.ConvertPointToData(behav.Position).FirstValue;
            }

            Func<int, int> next = GetPositionXFunction(direction);
            object adjacentXCategory = null;
            int startX = GetCoercedPositionX(behav);
            for (int x = startX; chart.PlotAreaClip.X <= x && x <= chart.PlotAreaClip.Right; x = next(x))
            {
                DataTuple tuple = chart.ConvertPointToData(new Point(x, 0));
                if (!object.Equals(currentXCategory, tuple.FirstValue))
                {
                    adjacentXCategory = tuple.FirstValue;
                    break;
                }
            }

            var adjacentPosition = chart.ConvertDataToPoint(new DataTuple(adjacentXCategory, null));
            adjacentPosition.Y = behav.Chart.ActualHeight / 2;

            behav.Position = adjacentPosition;
        }
コード例 #9
0
        public IRawElementProviderFragment Navigate(NavigateDirection direction)
        {
            switch (direction)
            {
            case NavigateDirection.Parent:
                // TODO: Review this
                // "Fragment roots do not enable navigation to
                // a parent or siblings; navigation among fragment
                // roots is handled by the default window providers."
                // Source: http://msdn.microsoft.com/en-us/library/system.windows.automation.provider.irawelementproviderfragment.navigate.aspx
                return(((IRawElementProviderFragment)Parent) ?? Provider.FragmentRoot);

            case NavigateDirection.FirstChild:
                return(_firstChild);

            case NavigateDirection.LastChild:
                return(_lastChild);

            case NavigateDirection.NextSibling:
                return(_nextProvider);

            case NavigateDirection.PreviousSibling:
                return(_previousProvider);

            default:
                return(null);
            }
        }
コード例 #10
0
        public void ItIsAwareOfItsSurroundings(NavigateDirection whichWay)
        {
            var expectedSurrounding = GetMockChild();

            _automationProvider.Set(whichWay, expectedSurrounding.Object);
            _automationProvider.Navigate(whichWay)
            .Should().BeSameAs(expectedSurrounding.Object);
        }
コード例 #11
0
 public override IRawElementProviderFragment Navigate(NavigateDirection direction)
 {
     if (direction == NavigateDirection.FirstChild || direction == NavigateDirection.LastChild)
     {
         UpdateCustomProvidersChildrenStructure();
     }
     return(base.Navigate(direction));
 }
コード例 #12
0
        public virtual void OnNavigationRequested(NavigateDirection direction)
        {
            var navigationRequested = this.NavigationRequested;

            if (navigationRequested != null)
            {
                navigationRequested(this, direction);
            }
        }
コード例 #13
0
        public virtual void OnDeleteRequested(NavigateDirection direction)
        {
            var deleteRequested = this.DeleteRequested;

            if (deleteRequested != null)
            {
                deleteRequested(this, direction);
            }
        }
コード例 #14
0
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            if (direction == NavigateDirection.Parent)
            {
                return((IRawElementProviderFragment)_parent.ProviderFromPeer(_parent));
            }

            return(null);
        }
コード例 #15
0
        protected override void OnNavigatedTo(NavigateDirection direction, object parameter)
        {
            base.OnNavigatedTo(direction, parameter);

            WaitingForAgent    = false; // reset status to false however we get here
            Error              = string.Empty;
            MeetingJoined      = false;
            RequestInProgress  = false;
            ConnectedToMeeting = false;
        }
コード例 #16
0
        public NavigateToHighlightedReferenceCommandArgs(ITextView textView, ITextBuffer subjectBuffer, NavigateDirection direction)
            : base(textView, subjectBuffer)
        {
            if (!Enum.IsDefined(typeof(NavigateDirection), direction))
            {
                throw new ArgumentException("direction");
            }

            _direction = direction;
        }
コード例 #17
0
        public NavigateToHighlightedReferenceCommandArgs(ITextView textView, ITextBuffer subjectBuffer, NavigateDirection direction)
            : base(textView, subjectBuffer)
        {
            if (!Enum.IsDefined(typeof(NavigateDirection), direction))
            {
                throw new ArgumentException("direction");
            }

            _direction = direction;
        }
コード例 #18
0
        protected override void OnNavigatedTo(NavigateDirection direction, object parameter)
        {
            base.OnNavigatedTo(direction, parameter);

            if (direction == NavigateDirection.Forward)
            {
                Meeting             = (MeetingViewModel)parameter;
                Meeting.Annotations = new ClientAnnotationViewModel(_sharedDataService, Meeting);
            }
        }
コード例 #19
0
ファイル: ElementProxy.cs プロジェクト: dox0/DotNet471RS3
        // IRawElementProviderFragment methods...

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

            if (peer == null)
            {
                return(null);
            }
            return((IRawElementProviderFragment)ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextNavigate), direction));
        }
コード例 #20
0
        public IRawElementProviderFragment Navigate(NavigateDirection direction)
        {
            IRawElementProviderFragment connection = null;

            if (connections.TryGetValue(direction, out connection))
            {
                return(connection);
            }
            return(null);
        }
コード例 #21
0
ファイル: ElementProxy.cs プロジェクト: dox0/DotNet471RS3
        // Return proxy representing element in specified direction (parent/next/firstchild/etc.)
        private object InContextNavigate(object arg)
        {
            NavigateDirection direction = (NavigateDirection)arg;
            AutomationPeer    dest;
            AutomationPeer    peer = Peer;

            if (peer == null)
            {
                return(null);
            }

            switch (direction)
            {
            case NavigateDirection.Parent:
                dest = peer.GetParent();
                break;

            case NavigateDirection.FirstChild:
                if (!peer.IsInteropPeer)
                {
                    dest = peer.GetFirstChild();
                }
                else
                {
                    return(peer.GetInteropChild());
                }
                break;

            case NavigateDirection.LastChild:
                if (!peer.IsInteropPeer)
                {
                    dest = peer.GetLastChild();
                }
                else
                {
                    return(peer.GetInteropChild());
                }
                break;

            case NavigateDirection.NextSibling:
                dest = peer.GetNextSibling();
                break;

            case NavigateDirection.PreviousSibling:
                dest = peer.GetPreviousSibling();
                break;

            default:
                dest = null;
                break;
            }

            return(StaticWrap(dest, peer));
        }
コード例 #22
0
 protected override void OnNavigatedTo(NavigateDirection direction, object parameter)
 {
     if (direction == NavigateDirection.Forward)
     {
         Meeting             = (MeetingViewModel)parameter;
         Meeting.Annotations = new AgentAnnotationViewModel(_sharedDataService, Meeting);
         _agentConnection.ObserveRoom(Meeting.Id);
     }
     NavigationPane.IsToolLibraryButtonHidden      = false;
     NavigationPane.IsUpcomingMeetingsButtonHidden = false;
 }
コード例 #23
0
ファイル: LocalProviderTest.cs プロジェクト: ABEMBARKA/monoUI
 public virtual IRawElementProviderFragment Navigate(NavigateDirection direction)
 {
     if (direction == NavigateDirection.Parent)
     {
         return(Root);
     }
     else
     {
         return(null);
     }
 }
コード例 #24
0
ファイル: LocalProviderTest.cs プロジェクト: ABEMBARKA/monoUI
 public override IRawElementProviderFragment Navigate(NavigateDirection direction)
 {
     if (direction == NavigateDirection.FirstChild || direction == NavigateDirection.LastChild)
     {
         return(Child);
     }
     else
     {
         return(null);
     }
 }
コード例 #25
0
        private async Task AssertPosition(string fileContent, NavigateDirection navigateDirection)
        {
            var fileContentNoPercentMarker = TestHelpers.RemovePercentMarker(fileContent);
            var workspace = await TestHelpers.CreateSimpleWorkspace(fileContentNoPercentMarker, "test.cs");

            var finalCursorLineColumn = TestHelpers.GetLineAndColumnFromPercent(TestHelpers.RemoveDollarMarker(fileContent));
            var response = await SendRequest(workspace, "test.cs", fileContentNoPercentMarker, navigateDirection);

            Assert.Equal(finalCursorLineColumn.Line, response.Line);
            Assert.Equal(finalCursorLineColumn.Column, response.Column);
        }
コード例 #26
0
 IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
 {
     if (direction == NavigateDirection.Parent)
     {
         return((IRawElementProviderFragment)ItemContainingGrid);
     }
     else
     {
         return(null);
     };
 }
コード例 #27
0
 /// <summary>
 /// Navigates to adjacent elements in the UI Automation tree.
 /// </summary>
 /// <param name="direction">Direction of navigation.</param>
 /// <returns>The element in that direction, or null.</returns>
 /// <remarks>The provider only returns directions that it is responsible for.
 /// UI Automation knows how to navigate between HWNDs, so only the custom item
 /// navigation needs to be provided.
 ///</remarks>
 IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
 {
     if (direction == NavigateDirection.FirstChild)
     {
         return(GetProviderForIndex(0));
     }
     else if (direction == NavigateDirection.LastChild)
     {
         return(GetProviderForIndex(OwnerListControl.ItemCount - 1));
     }
     return(null);
 }
コード例 #28
0
 private void OnNavigate(NavigateDirection obj)
 {
     if (_navigationEnabled)
     {
         Selectable newObj = FindSelectableInDirection(dir: obj);
         if (newObj)
         {
             _currentlySelected.targetGraphic.color = _currentlySelected.colors.normalColor;
             Select(obj: newObj);
         }
     }
 }
コード例 #29
0
 // Routing function for going to neighboring elements.  We implemented
 // this to delegate to other virtual functions, so don't override it.
 public IRawElementProviderFragment Navigate(NavigateDirection direction)
 {
     switch (direction)
     {
         case NavigateDirection.NavigateDirection_Parent: return parent;
         case NavigateDirection.NavigateDirection_FirstChild: return GetFirstChild();
         case NavigateDirection.NavigateDirection_LastChild: return GetLastChild();
         case NavigateDirection.NavigateDirection_NextSibling: return GetNextSibling();
         case NavigateDirection.NavigateDirection_PreviousSibling: return GetPreviousSibling();
     }
     return null;
 }
コード例 #30
0
            internal override IRawElementProviderFragment?FragmentNavigate(NavigateDirection direction)
            {
                if (!_owningTabControl.IsHandleCreated)
                {
                    return(null);
                }

                return(direction switch
                {
                    NavigateDirection.FirstChild => _owningTabControl.SelectedTab?.AccessibilityObject,
                    NavigateDirection.LastChild => _owningTabControl.TabPages.Count > 0
                                                            ? _owningTabControl.TabPages[^ 1].TabAccessibilityObject
コード例 #31
0
ファイル: Navigation.cs プロジェクト: ABEMBARKA/monoUI
        public static AutomationPeer Navigate(this AutomationPeer peer, NavigateDirection direction)
        {
            List <AutomationPeer> children = null;

            if (direction == NavigateDirection.FirstChild || direction == NavigateDirection.LastChild)
            {
                children = peer.GetChildren();
                if (children == null || children.Count == 0)
                {
                    return(null);
                }

                if (direction == NavigateDirection.FirstChild)
                {
                    return(children [0]);
                }

                return(children [children.Count - 1]);
            }

            var parent = peer.GetParent();

            if (direction == NavigateDirection.Parent || parent == null)
            {
                return(parent);
            }

            children = parent.GetChildren();
            if (children == null)
            {
                return(null);
            }

            AutomationPeer previous = null;
            AutomationPeer current  = null;

            foreach (AutomationPeer child in children)
            {
                previous = current;
                current  = child;

                if (child == peer && direction == NavigateDirection.PreviousSibling)
                {
                    return(previous);
                }

                if (previous == peer && direction == NavigateDirection.NextSibling)
                {
                    return(current);
                }
            }
            return(null);
        }
コード例 #32
0
 IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
 {
     if (direction == NavigateDirection.FirstChild)
     {
         // Return the provider that is the sole child of this one.
         return((IRawElementProviderFragment)gridItems[0, 0]);
     }
     else
     {
         return(null);
     };
 }
コード例 #33
0
 // <Snippet105>
 IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
 {
     if ((direction == NavigateDirection.FirstChild) ||
         (direction == NavigateDirection.LastChild))
     {
         // Return the provider that is the sole child of this one.
         return((IRawElementProviderFragment)ChildControl);
     }
     else
     {
         return(null);
     };
 }
            internal override IRawElementProviderFragment?FragmentNavigate(NavigateDirection direction)
            {
                if (!OwningScrollBar.IsHandleCreated)
                {
                    return(null);
                }

                return(direction switch
                {
                    NavigateDirection.PreviousSibling => IsDisplayed ? ParentInternal.ThumbAccessibleObject: null,
                    NavigateDirection.NextSibling => IsDisplayed ? ParentInternal.LastLineButtonAccessibleObject : null,
                    _ => base.FragmentNavigate(direction)
                });
コード例 #35
0
ファイル: Navigation.cs プロジェクト: mono/uia2atk
		public static AutomationPeer Navigate (this AutomationPeer peer, NavigateDirection direction)
		{
			List<AutomationPeer> children = null;
			if (direction == NavigateDirection.FirstChild || direction == NavigateDirection.LastChild) {
				children = peer.GetChildren ();
				if (children == null || children.Count == 0)
					return null;

				if (direction == NavigateDirection.FirstChild)
					return children [0];

				return children [children.Count - 1];
			}

			var parent = peer.GetParent ();

			if (direction == NavigateDirection.Parent || parent == null)
				return parent;

			children = parent.GetChildren ();
			if (children == null)
				return null;

			AutomationPeer previous = null;
			AutomationPeer current = null;
			foreach (AutomationPeer child in children) {
				previous = current;
				current = child;

				if (child == peer && direction == NavigateDirection.PreviousSibling)
					return previous;

				if (previous == peer && direction == NavigateDirection.NextSibling)
					return current;
			}
			return null;
		}
コード例 #36
0
 private async Task AssertPosition(string fileContent, NavigateDirection navigateDirection)
 {
     var fileContentNoPercentMarker = TestHelpers.RemovePercentMarker(fileContent);
     var workspace = TestHelpers.CreateSimpleWorkspace(fileContentNoPercentMarker, "test.cs");
     var response = await SendRequest(workspace, "test.cs", fileContentNoPercentMarker, navigateDirection);
     var finalCursorLineColumn = TestHelpers.GetLineAndColumnFromPercent(TestHelpers.RemoveDollarMarker(fileContent));
     Assert.Equal(finalCursorLineColumn.Line, response.Line);
     Assert.Equal(finalCursorLineColumn.Column, response.Column);
 }
コード例 #37
0
        void IScreenViewModel.OnNavigatedTo(NavigateDirection direction, object parameter)
        {
            IsActive = true;

            OnNavigatedTo(direction, parameter);
        }
コード例 #38
0
ファイル: Host.cs プロジェクト: toptensoftware/UIAutoTest
 IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
 {
     switch (direction)
     {
         case NavigateDirection.FirstChild:
             return _controls[0].AutomationPeer;
         case NavigateDirection.LastChild:
             return _controls[_controls.Count - 1].AutomationPeer;
     }
     return null;
 }
コード例 #39
0
        /// <summary>
        /// Retrieves the UI Automation element in a specified direction within the tree.
        /// </summary>
        /// <param name="direction">The direction in which to navigate.</param>
        /// <returns>
        /// The element in the specified direction, or null if there is no element in that direction
        /// </returns>
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            switch (direction)
            {
                case NavigateDirection.FirstChild:
                    if (_row.HeaderCell.Visible)
                        return new AutomationDataGridViewHeaderCell(_grid, this, _row.HeaderCell);
                    else
                        return new AutomationDataGridViewCell(_grid, this, _row.Cells.OfType<DataGridViewCell>().Where(o => o.Visible).OrderBy(o => o.OwningColumn.DisplayIndex).First());

                case NavigateDirection.LastChild:
                    return new AutomationDataGridViewCell(_grid, this, _row.Cells.OfType<DataGridViewCell>().Where(o => o.Visible).OrderByDescending(o => o.OwningColumn.DisplayIndex).First());

                case NavigateDirection.NextSibling:
                    if (_row.Index < _grid.Rows.Count - 1)
                    {
                        return new AutomationDataGridViewRow(_grid, _grid.Rows[_row.Index + 1]);
                    }
                    break;

                case NavigateDirection.PreviousSibling:
                    if (_row.Index > 0)
                    {
                        return new AutomationDataGridViewRow(_grid, _grid.Rows[_row.Index - 1]);
                    }
                    break;

                case NavigateDirection.Parent:
                    return _grid;
            }

            return null;
        }
コード例 #40
0
        public IRawElementProviderFragment Navigate(NavigateDirection direction)
        {
            switch (direction)
            {
                case NavigateDirection.NextSibling:
                    return nextHeaderCell();

                case NavigateDirection.PreviousSibling:
                    return previousHeaderCell();

                case NavigateDirection.Parent:
                    return _parent;
            }

            return null;
        }
コード例 #41
0
 /// <summary>
 /// Navigates the browser the specified direction.
 /// </summary>
 /// <param name="navigationDirection">The navigation direction.</param>
 public abstract void Navigate(NavigateDirection navigationDirection);
コード例 #42
0
 IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
 {
     HwndProxyElementProvider dest = null;
     switch (direction)
     {
         case NavigateDirection.Parent:          dest = GetParent(); break;
         case NavigateDirection.FirstChild:      dest = GetFirstChild(); break;
         case NavigateDirection.LastChild:       dest = GetLastChild(); break;
         case NavigateDirection.NextSibling:     dest = GetNextSibling(); break;
         case NavigateDirection.PreviousSibling: dest = GetPreviousSibling(); break;
     }
     return dest;
 }
コード例 #43
0
        /// <SecurityNote> 
        ///     TreatAsSafe - The reason this method can be treated as safe is because it yeilds information 
        ///         about the parent provider which can even otherwise be obtained by using public APIs such
        ///         as UIElement.OnCreateAutomationPeer and AutomationProvider.ProviderFromPeer. 
        /// </SecurityNote>
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            if (direction == NavigateDirection.Parent) 
            {
                return (IRawElementProviderFragment)_parent.ProviderFromPeer(_parent); 
            } 

            return null; 
        }
コード例 #44
0
		public void SetConnection (IRawElementProviderFragment provider,
		                           NavigateDirection direction)
		{
			connections [direction] = provider;
		}
コード例 #45
0
		public IRawElementProviderFragment Navigate (NavigateDirection direction)
		{
			IRawElementProviderFragment connection = null;
			if (connections.TryGetValue (direction, out connection))
				return connection;
			return null;
		}
コード例 #46
0
ファイル: ElementProxy.cs プロジェクト: JianwenSun/cc
        // IRawElementProviderFragment methods...

        public IRawElementProviderFragment Navigate( NavigateDirection direction )
        {
            AutomationPeer peer = Peer;
            if (peer == null)
            {
                return null;
            }
            return (IRawElementProviderFragment)ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextNavigate), direction);
        }
コード例 #47
0
 public IRawElementProviderFragment Navigate(NavigateDirection direction)
 {
     return null;
 }
コード例 #48
0
        protected override void OnNavigatedTo(NavigateDirection direction, object parameter)
        {
            base.OnNavigatedTo(direction, parameter);

            if (direction == NavigateDirection.Forward)
            {
                Meeting = (MeetingViewModel)parameter;
                Meeting.Annotations = new ClientAnnotationViewModel(_sharedDataService, Meeting);
            }
        }
コード例 #49
0
ファイル: ProxySimple.cs プロジェクト: JianwenSun/cc
        // Request to return the element in the specified direction
        // ProxySimple object are leaf so it returns null except for the parent
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            System.Diagnostics.Debug.Assert(_parent != null, "Navigate: Leaf element does not have parent");
            switch (direction)
            {
                case NavigateDirection.Parent:
                    {
                        return GetParent();
                    }

                case NavigateDirection.NextSibling:
                    {
                        // NOTE: Do not use GetParent(), call _parent explicitly
                        return _parent.GetNextSibling(this);
                    }

                case NavigateDirection.PreviousSibling:
                    {
                        // NOTE: Do not use GetParent(), call _parent explicitly
                        return _parent.GetPreviousSibling(this);
                    }
            }
            return null;
        }
コード例 #50
0
        private async Task<NavigateResponse> SendRequest(OmnisharpWorkspace workspace, string fileName, string fileContent, NavigateDirection upOrDown)
        {
            var initialCursorLineColumn = TestHelpers.GetLineAndColumnFromDollar(TestHelpers.RemovePercentMarker(fileContent));
            var fileContentNoDollarMarker = TestHelpers.RemoveDollarMarker(fileContent);
            var naviagteUpService = new NavigateUpService(workspace);
            var navigateDownService = new NavigateDownService(workspace);

            if (upOrDown == NavigateDirection.UP)
            {
                var request = new NavigateUpRequest
                {
                    Line = initialCursorLineColumn.Line,
                    Column = initialCursorLineColumn.Column,
                    FileName = fileName,
                    Buffer = fileContentNoDollarMarker
                };
                return await naviagteUpService.Handle(request);
            }
            else
            {
                var request = new NavigateDownRequest
                {
                    Line = initialCursorLineColumn.Line,
                    Column = initialCursorLineColumn.Column,
                    FileName = fileName,
                    Buffer = fileContentNoDollarMarker
                };
                return await navigateDownService.Handle(request);
            }
        }
コード例 #51
0
        /// <summary>
        /// Retrieves the UI Automation element in a specified direction within the tree.
        /// </summary>
        /// <param name="direction">The direction in which to navigate.</param>
        /// <returns>
        /// The element in the specified direction, or null if there is no element in that direction
        /// </returns>
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            switch (direction)
            {
                case NavigateDirection.FirstChild:
                    return new AutomationDataGridViewHeaderCell(_grid, this, _grid.Columns.OfType<DataGridViewColumn>().Where(o => o.Visible).OrderBy(o => o.DisplayIndex).First().HeaderCell);

                case NavigateDirection.LastChild:
                    return new AutomationDataGridViewHeaderCell(_grid, this, _grid.Columns.OfType<DataGridViewColumn>().Where(o => o.Visible).OrderByDescending(o => o.DisplayIndex).First().HeaderCell);

                case NavigateDirection.NextSibling:
                    if (_grid.RowCount > 0)
                        return new AutomationDataGridViewRow(_grid, _grid.Rows[0]);
                    break;

                case NavigateDirection.Parent:
                    return _grid;
            }

            return null;
        }
コード例 #52
0
 public GoToAdjacentMemberCommandArgs(ITextView textView, ITextBuffer subjectBuffer, NavigateDirection direction)
     : base(textView, subjectBuffer)
 {
     Direction = direction;
 }
コード例 #53
0
        /// <summary>
        /// Retrieves the UI Automation element in a specified direction within the tree.
        /// </summary>
        /// <param name="direction">The direction in which to navigate.</param>
        /// <returns>
        /// The element in the specified direction, or null if there is no element in that direction
        /// </returns>
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            if (this.Rows.Count > 0)
            {
                switch (direction)
                {
                    case NavigateDirection.FirstChild:
                        return new AutomationDataGridViewHeaderRow(this);
                    case NavigateDirection.LastChild:
                        return new AutomationDataGridViewRow(this, Rows[Rows.Count - 1]);
                }
            }

            return null;
        }
コード例 #54
0
        // Request to return the element in the specified direction
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            switch (direction)
            {
                case NavigateDirection.NextSibling :
                    {
                        // NOTE: Do not use GetParent(), call _parent explicitly
                        return _fSubTree ? _parent.GetNextSibling (this) : null;
                    }

                case NavigateDirection.PreviousSibling :
                    {
                        // NOTE: Do not use GetParent(), call _parent explicitly
                        return _fSubTree ? _parent.GetPreviousSibling (this) : null;
                    }

                case NavigateDirection.FirstChild :
                    {
                        return GetFirstChild ();
                    }

                case NavigateDirection.LastChild :
                    {
                        return GetLastChild ();
                    }

                case NavigateDirection.Parent :
                    {
                        return GetParent ();
                    }

                default :
                    {
                        return null;
                    }
            }
        }
コード例 #55
0
        /// <summary>
        /// Retrieves the UI Automation element in a specified direction within the tree.
        /// </summary>
        /// <param name="direction">The direction in which to navigate.</param>
        /// <returns>
        /// The element in the specified direction, or null if there is no element in that direction
        /// </returns>
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            switch (direction)
            {
                case NavigateDirection.NextSibling:
                    return nextCell();
                case NavigateDirection.PreviousSibling:
                    return previousCell();
                case NavigateDirection.Parent:
                    return _row;
            }

            return null;
        }
コード例 #56
0
        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            if (NavigateHandler != null)
            {
                var peer = NavigateHandler(direction);
                if (peer != null)
                    return peer;

                if (direction == NavigateDirection.Parent && GetFragmentRoot != null)
                {
                    return GetFragmentRoot();
                }
            }
            return null;
        }
コード例 #57
0
 protected override void OnNavigatedTo(NavigateDirection direction, object parameter)
 {
     if (direction == NavigateDirection.Forward)
     {
         Meeting = (MeetingViewModel)parameter;
         Meeting.Annotations = new AgentAnnotationViewModel(_sharedDataService, Meeting);
         _agentConnection.ObserveRoom(Meeting.Id);
     }
     NavigationPane.IsToolLibraryButtonHidden = false;
     NavigationPane.IsUpcomingMeetingsButtonHidden = false;
 }
コード例 #58
0
ファイル: AutomationElement.cs プロジェクト: JianwenSun/cc
        // Called by the treewalker classes to navigate - we call through to the
        // provider wrapper, which gets the navigator code to do its stuff
        internal AutomationElement Navigate(NavigateDirection direction, Condition condition, CacheRequest request)
        {
            CheckElement();

            UiaCoreApi.UiaCacheRequest cacheRequest;
            if (request == null)
                cacheRequest = CacheRequest.DefaultUiaCacheRequest;
            else
                cacheRequest = request.GetUiaCacheRequest();

            UiaCoreApi.UiaCacheResponse response = UiaCoreApi.UiaNavigate(_hnode, direction, condition, cacheRequest);
            return CacheHelper.BuildAutomationElementsFromResponse(cacheRequest, response);
        }
コード例 #59
0
        //------------------------------------------------------
        //
        //  Interface IRawElementProviderFragment
        //
        //------------------------------------------------------

        #region IRawElementProviderFragment

        IRawElementProviderFragment IRawElementProviderFragment.Navigate(NavigateDirection direction)
        {
            //Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "{0} IRawElementProviderFragment.Navigate {1}", this, direction));

            MsaaNativeProvider rval = null;
            
            switch (direction)
            {
                case NavigateDirection.NextSibling:
                    rval = GetNextSibling();
                    break;

                case NavigateDirection.PreviousSibling:
                    rval = GetPreviousSibling();
                    break;

                case NavigateDirection.FirstChild:
                    rval = GetFirstChild();
                    break;

                case NavigateDirection.LastChild:
                    rval = GetLastChild();
                    break;

                case NavigateDirection.Parent:
                    rval = IsRoot ? null : Parent;
                    break;

                default:
                    Debug.Assert(false);
                    break;
            }

            return rval;
        }
コード例 #60
0
        private async Task<NavigateResponse> SendRequest(OmnisharpWorkspace workspace, string fileName, string fileContent, NavigateDirection upOrDown)
        {
            var initialCursorLineColumn = TestHelpers.GetLineAndColumnFromDollar(TestHelpers.RemovePercentMarker(fileContent));
            var fileContentNoDollarMarker = TestHelpers.RemoveDollarMarker(fileContent);
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var request = new Request
            {
                Line = initialCursorLineColumn.Line,
                Column = initialCursorLineColumn.Column,
                FileName = fileName,
                Buffer = fileContentNoDollarMarker
            };

            if (upOrDown == NavigateDirection.UP)
            {
                return await controller.NavigateUp(request);
            }
            else
            {
                return await controller.NavigateDown(request);
            }
        }