public void Process(ILayoutElement layoutElement) { switch (Alignment) { case HorizontalAlign.Left: layoutElement.MoveTo(0f, _y); break; case HorizontalAlign.Center: layoutElement.MoveTo((_container.Rectangle.Width - layoutElement.RectangleWithMargin.Width) / 2f, _y); break; case HorizontalAlign.Right: layoutElement.MoveTo(_container.Rectangle.Width - layoutElement.RectangleWithMargin.Width, _y); break; } _y += layoutElement.RectangleWithMargin.Height + Spacing; }
public void Process(ILayoutElement layoutElement) { switch (Alignment) { case VerticalAlign.Top: layoutElement.MoveTo(_x, 0f); break; case VerticalAlign.Middle: layoutElement.MoveTo(_x, (_container.Rectangle.Height - layoutElement.RectangleWithMargin.Height) / 2f); break; case VerticalAlign.Bottom: layoutElement.MoveTo(_x, _container.Rectangle.Height - layoutElement.RectangleWithMargin.Height); break; } _x += layoutElement.RectangleWithMargin.Width + Spacing; }
private void PlaceAtCurrentPosition(ILayoutElement layoutElement) { // Update position. layoutElement.MoveTo(currentX, currentY); }