protected virtual int CalcHour(DateTime source, int hour, TimeEditPopupControlViewInfo viewInfo) { if (viewInfo.FocusedHour != null) { hour = int.Parse(viewInfo.FocusedHour.CellText); } else { hour = source.Hour; } if (viewInfo.Format != null && viewInfo.Format.CellText == "PM") { hour += 12; } if (viewInfo.Format != null && viewInfo.Format.CellText == "AM") { hour = hour > 11 ? hour -= 12 : hour; } if (hour >= 24) { hour -= 24; } return(hour); }
protected virtual int CalcMinute(DateTime source, int minute, TimeEditPopupControlViewInfo viewInfo) { if (ViewInfo.FocusedMinute != null) { minute = int.Parse(viewInfo.FocusedMinute.CellText); } else { minute = source.Minute; } return(minute); }
protected virtual void CreateViewInfo() { ViewInfo = new TimeEditPopupControlViewInfo(OwnerEdit, this); }
public TimeEditPopupControlPainter(TimeEditPopupControlViewInfo viewInfo) { PopupViewInfo = viewInfo; }