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 to the left of this element /// </summary> /// <returns></returns> public UINode GetNodeLeft() { if (nodeLeft == null || uiNodeSearched) { uiNodeSearched = false; return(null); } uiNodeSearched = true; UINode uiNodeToReturn = nodeLeft; if (!nodeLeft.uiNodeActive) { uiNodeToReturn = nodeLeft.GetNodeLeft(); } uiNodeSearched = false; return(uiNodeToReturn); }