public override void Layout()
{
if (StringOrientation == StringOrientations.Vertical)
{
int width = _bottomRight.X - _topLeft.X;
int height = _bottomRight.Y - _topLeft.Y;
double stringXSpacing = (double)width / (double)(StringCount - 1);
int x = _topLeft.X;
int y = _topLeft.Y;
for (int stringNum = 0; stringNum < StringCount; stringNum++)
{
PreviewLine line = _strings[stringNum] as PreviewLine;
line.SetPoint0(x, y + height);
line.SetPoint1(x, y);
line.Layout();
x += (int)stringXSpacing;
}
}
else
{
int width = _bottomRight.X - _bottomLeft.X;
int height = _bottomLeft.Y - _topLeft.Y;
double stringYSpacing = (double)height / (double)(StringCount - 1);
int x = _bottomLeft.X;
int y = _bottomLeft.Y;
for (int stringNum = 0; stringNum < StringCount; stringNum++)
{
PreviewLine line = _strings[stringNum] as PreviewLine;
line.SetPoint0(x, y);
line.SetPoint1(x + width, y);
line.Layout();
y -= (int)stringYSpacing;
}
}
}