Пример #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="baseItem"></param>
        /// <param name="length">Rectangle array length</param>
        public ItemRects(BaseItem baseItem, int length)
        {
            _ItemRects = new ItemRect[length];

            for (int i = 0; i < length; i++)
                _ItemRects[i] = new ItemRect(baseItem);
        }
Пример #2
0
        /// <summary>
        /// DrawDayContentText
        /// </summary>
        /// <param name="g"></param>
        /// <param name="date"></param>
        /// <param name="ir"></param>
        private void DrawDayContentText(
            Graphics g, DateTime date, ItemRect ir)
        {
            if (_YearView.CalendarView.DoYearViewDrawDayText(g, this, date, ir.Bounds) == false)
            {
                Font font = _YearView.Font;
                Color color = _YearView.ViewColor.GetColor((int)eCalendarMonthPart.DayHeaderForeground);

                if (_AppBits.Get(date.Day - 1) == true)
                {
                    font = _YearView.BoldFont;
                    color = _YearView.ViewColor.GetColor((int)eCalendarMonthPart.ContentLinkForeground);
                }

                TextDrawing.DrawString(g, date.Day.ToString(), font, color, ir.Bounds,
                                       eTextFormat.VerticalCenter | eTextFormat.HorizontalCenter |
                                       eTextFormat.NoPadding);
            }
        }
Пример #3
0
        /// <summary>
        /// DrawDayContentBackground
        /// </summary>
        /// <param name="g"></param>
        /// <param name="date"></param>
        /// <param name="ir"></param>
        /// <param name="color1"></param>
        /// <param name="color2"></param>
        private void DrawDayContentBackground(Graphics g,
            DateTime date, ItemRect ir, Color color1, Color color2)
        {
            CalendarView cv = _YearView.CalendarView;

            if (_YearView.AllowDateSelection == false || ir.IsSelected == false)
            {
                if (_AppBits.Get(date.Day - 1) == true)
                {
                    using (Brush br = _YearView.ViewColor.BrushPart(
                        (int) eCalendarMonthPart.ContentLinkBackground, ir.Bounds))
                    {
                        g.FillRectangle(br, ir.Bounds);
                    }
                }
            }

            eYearViewLinkStyle linkStyle = cv.YearViewAppointmentLinkStyle;

            if (cv.DoYearViewDrawDayBackground(
                g, this, date, ir.Bounds, ref linkStyle) == false)
            {
                if (_YearView.AllowDateSelection == true && ir.IsSelected == true)
                {
                    using (Brush br = _YearView.ViewColor.BrushPart(
                        (int) eCalendarMonthPart.DayContentSelectionBackground, ir.Bounds))
                    {
                        g.FillRectangle(br, ir.Bounds);
                    }
                }

                if (_AppBits.Get(date.Day - 1) == true)
                {
                    if (ir.IsSelected == false)
                        DrawDayHighLight(g, linkStyle, ir.Bounds, color1, color2);
                }
            }
        }