public bool HasLayout(Direction direction) { if (OneLayoutAtATime) { switch (direction) { case Direction.Left: if (CurrentLayout.LayoutPosition.Left != null) { return(true); } break; case Direction.Right: if (CurrentLayout.LayoutPosition.Right != null) { return(true); } break; case Direction.Up: if (CurrentLayout.LayoutPosition.Top != null) { return(true); } break; case Direction.Down: if (CurrentLayout.LayoutPosition.Bottom != null) { return(true); } break; default: throw new ArgumentOutOfRangeException("direction"); } } return(false); }
public void ChangeLayout(Direction direction) { if (OneLayoutAtATime) { switch (direction) { case Direction.Left: if (CurrentLayout.LayoutPosition.Left != null) { ChangeLayout(CurrentLayout.LayoutPosition.Left); } break; case Direction.Right: if (CurrentLayout.LayoutPosition.Right != null) { ChangeLayout(CurrentLayout.LayoutPosition.Right); } break; case Direction.Up: if (CurrentLayout.LayoutPosition.Top != null) { ChangeLayout(CurrentLayout.LayoutPosition.Top); } break; case Direction.Down: if (CurrentLayout.LayoutPosition.Bottom != null) { ChangeLayout(CurrentLayout.LayoutPosition.Bottom); } break; default: throw new ArgumentOutOfRangeException("direction"); } } }