private bool GetReserveItem(Point cursorPos, ref ReserveData reserve)
{
try
{
if (timeList.Count > 0)
{
int timeIndex = (int)Math.Floor(cursorPos.Y / (60 * Settings.Instance.MinHeight));
TimePosInfo time = timeList.GetByIndex(timeIndex) as TimePosInfo;
foreach (ReserveViewItem resInfo in time.ReserveList)
{
if (resInfo.LeftPos <= cursorPos.X && cursorPos.X < resInfo.LeftPos + resInfo.Width &&
resInfo.TopPos <= cursorPos.Y && cursorPos.Y < resInfo.TopPos + resInfo.Height)
{
reserve = resInfo.ReserveInfo;
return true;
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
return false;
}