private void MoveToNextElemt(UIDirection direction) { UINode uiNodeToMoveTo = null; switch (direction) { case UIDirection.Up: uiNodeToMoveTo = currentNodeSelected.GetNodeUp(); break; case UIDirection.Down: uiNodeToMoveTo = currentNodeSelected.GetNodeDown(); break; case UIDirection.Right: uiNodeToMoveTo = currentNodeSelected.GetNodeRight(); break; case UIDirection.Left: uiNodeToMoveTo = currentNodeSelected.GetNodeLeft(); break; } if (uiNodeToMoveTo == null) { return; } this.currentNodeSelected = uiNodeToMoveTo; }
/// <summary> /// Gets a ui element that is below this ui element /// </summary> /// <returns></returns> public UINode GetNodeDown() { if (nodeDown == null || uiNodeSearched) { uiNodeSearched = false; return(null); } uiNodeSearched = true; UINode uiNodeToReturn = nodeDown; if (!nodeDown.uiNodeActive) { uiNodeToReturn = nodeDown.GetNodeDown(); } uiNodeSearched = false; return(uiNodeToReturn); }