示例#1
0
        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);
        }
示例#2
0
 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);
 }
示例#3
0
 protected virtual void CreateViewInfo()
 {
     ViewInfo = new TimeEditPopupControlViewInfo(OwnerEdit, this);
 }
 public TimeEditPopupControlPainter(TimeEditPopupControlViewInfo viewInfo)
 {
     PopupViewInfo = viewInfo;
 }