using System.Collections.Generic;
|
using System.ComponentModel;
|
|
namespace HotelPms.Share.Windows.Report.Member
|
{
|
public class PrintRow
|
{
|
/// <summary>
|
/// 行のセル毎印刷情報
|
/// </summary>
|
public List<Cell> Cells { get; set; } = new List<Cell>();
|
|
/// <summary>
|
/// ディフォルトプロパティ
|
/// </summary>
|
/// <param name="index"></param>
|
/// <returns></returns>
|
public Cell this[int index] { get { return Cells[index]; } }
|
|
/// <summary>
|
/// 行の最大Y - 最小Y
|
/// </summary>
|
/// <param name="def"></param>
|
/// <returns></returns>
|
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;
|
}
|
}
|
}
|