using System.Collections.Generic;
using System.ComponentModel;
namespace HotelPms.Share.Windows.Report.Member
{
public class PrintRow
{
///
/// 行のセル毎印刷情報
///
public List Cells { get; set; } = new List| ();
///
/// ディフォルトプロパティ
///
///
///
public Cell this[int index] { get { return Cells[index]; } }
///
/// 行の最大Y - 最小Y
///
///
///
public float GetHeight(float def)
{
float rowHeight = def;
if (Cells.Count > 0)
{
float minY = 0F;
float maxY = 0F;
int i = 0;
foreach (Cell cell in Cells)
{
if (cell.Style == null) { continue; }
if (i == 0)
{
minY = cell.Style.Top;
maxY = cell.Style.Top + cell.Style.Height;
}
else
{
if (minY > cell.Style.Top) { minY = cell.Style.Top; }
if (maxY < (cell.Style.Top + cell.Style.Height)) { maxY = cell.Style.Top + cell.Style.Height; }
}
i++;
}
rowHeight = maxY - minY;
}
return rowHeight;
}
}
}
| |