Example #1
0
 public virtual void Draw(System.Drawing.Graphics graphics, DateViewInfo dateViewInfo)
 {
     DrawDay(graphics, dateViewInfo);
     DrawHour(graphics, dateViewInfo);
     DrawMinute(graphics, dateViewInfo);
     DrawSelection(graphics, dateViewInfo);
 }
Example #2
0
 internal void CalcViewInfo()
 {
     using (Graphics graphics = CreateGraphics())
     {
         MinimumSize = new Size(0, DateViewInfo.CalcMinHeight(graphics));
         DateViewInfo.CalcViewInfo(graphics);
     }
 }
Example #3
0
        protected virtual void DrawDigit(System.Drawing.Graphics graphics, DateViewInfo dateViewInfo, Rectangle rect, DateInfoType datePart)
        {
            Array positions = Enum.GetValues(typeof(PositionType));
            Brush brush     = Brushes.LightGray;

            foreach (PositionType positionType in positions)
            {
                Rectangle dateRect = dateViewInfo.GetRect(rect, positionType);
                if (dateViewInfo.Owner.SelectedDatePart == datePart)
                {
                    graphics.FillRectangle(Brushes.CornflowerBlue, dateRect);
                }

                string dayValue = dateViewInfo.Owner.GetDayValueByPosition(datePart, positionType).ToString();
                graphics.DrawString(dayValue, dateViewInfo.Font, GetBrush(positionType), dateRect);
            }
        }
Example #4
0
 protected virtual void DrawSelection(System.Drawing.Graphics graphics, DateViewInfo dateViewInfo)
 {
     graphics.DrawRectangle(GetSelectionPen(), dateViewInfo.SelectionBounds);
 }
Example #5
0
 protected virtual void DrawMinute(System.Drawing.Graphics graphics, DateViewInfo dateViewInfo)
 {
     DrawDigit(graphics, dateViewInfo, dateViewInfo.MinuteBounds, DateInfoType.Minute);
     graphics.DrawRectangle(Pens.Black, dateViewInfo.MinuteBounds);
 }
Example #6
0
 public DateHitInfo CalcHitInfo(Point point)
 {
     return(DateViewInfo.CalcHitInfo(point));
 }