/// <summary>
 /// Copies the parameters from the specified <see cref="CalendarRendererEventArgs"/>
 /// </summary>
 /// <param name="original"></param>
 public CalendarRendererEventArgs(CalendarRendererEventArgs original)
 {
     _calendar       = original.Calendar;
     _DrawingContext = original.DrawingContext;
     _clip           = original.ClipRect;
     _tag            = original.Tag;
 }
Example #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            CalendarRendererEventArgs evt = new CalendarRendererEventArgs(this, e.DrawingContext, e.ClipRect);

            ///Calendar background
            Renderer.OnDrawBackground(evt);

            /// Headers / Timescale
            switch (DaysMode)
            {
            case CalendarDaysMode.Short:
                Renderer.OnDrawDayNameHeaders(evt);
                Renderer.OnDrawWeekHeaders(evt);
                break;

            case CalendarDaysMode.Expanded:
                Renderer.OnDrawTimeScale(evt);
                break;

            default:
                throw new NotImplementedException("Current DaysMode not implemented");
            }

            ///Days on view
            Renderer.OnDrawDays(evt);

            ///Items
            Renderer.OnDrawItems(evt);

            ///Overflow marks
            Renderer.OnDrawOverflows(evt);
        }
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original, Rect bounds, string text, Color textColor)
     : this(original)
 {
     Bounds    = bounds;
     Text      = text;
     TextColor = textColor;
 }
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original, Rect bounds, string text, TextFormatFlags flags)
     : this(original)
 {
     Bounds  = bounds;
     Text    = text;
     Format |= flags;
 }
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original)
     : base(original)
 {
     Font      = original.Calendar.Font;
     Format   |= TextFormatFlags.Default | TextFormatFlags.WordBreak | TextFormatFlags.PreserveDrawingContextClipping;// | TextFormatFlags.WordEllipsis;
     TextColor = SystemColors.ControlText;
 }
Example #6
0
        public override void OnDrawTimeScale(CalendarRendererEventArgs e)
        {
            int margin  = 5;
            int largeX1 = TimeScaleBounds.Left + margin;
            int largeX2 = TimeScaleBounds.Right - margin;
            int shortX1 = TimeScaleBounds.Left + TimeScaleBounds.Width / 2;
            int shortX2 = largeX2;
            int top     = 0;
            Pen p       = new Pen(ColorTable.TimeScaleLine);

            for (int i = 0; i < e.Calendar.Days[0].TimeUnits.Length; i++)
            {
                CalendarTimeScaleUnit unit = e.Calendar.Days[0].TimeUnits[i];

                if (!unit.Visible)
                {
                    continue;
                }

                top = unit.Bounds.Top;

                if (unit.Minutes == 0)
                {
                    e.DrawingContext.DrawLine(p, largeX1, top, largeX2, top);
                }
                else
                {
                    e.DrawingContext.DrawLine(p, shortX1, top, shortX2, top);
                }
            }

            if (e.Calendar.DaysMode == CalendarDaysMode.Expanded &&
                e.Calendar.Days != null &&
                e.Calendar.Days.Length > 0 &&
                e.Calendar.Days[0].TimeUnits != null &&
                e.Calendar.Days[0].TimeUnits.Length > 0
                )
            {
                top = e.Calendar.Days[0].BodyBounds.Top;

                //Timescale top line is full
                e.DrawingContext.DrawLine(p, TimeScaleBounds.Left, top, TimeScaleBounds.Right, top);
            }

            p.Dispose();

            base.OnDrawTimeScale(e);
        }
 public CalendarRendererTimeUnitEventArgs(CalendarRendererEventArgs original, CalendarTimeScaleUnit unit)
     : base(original)
 {
     _unit = unit;
 }
Example #8
0
 public override void OnDrawBackground(CalendarRendererEventArgs e)
 {
     e.DrawingContext.DrawRectangle(new SolidColorBrush(ColorTable.Background), new Pen(), e.ClipRect);
 }
Example #9
0
 public override void OnDrawWeekHeaders(CalendarRendererEventArgs e)
 {
     base.OnDrawWeekHeaders(e);
 }
        public override void OnInitialize(CalendarRendererEventArgs e)
        {
            base.OnInitialize(e);

            e.Calendar.FontFamily = SystemFonts.CaptionFontFamily;
        }
 /// <summary>
 /// Creates a new <see cref="CalendarRendererDayEventArgs"/> object
 /// </summary>
 /// <param name="original">Orignal object to copy basic paramters</param>
 /// <param name="day">Day to render</param>
 public CalendarRendererDayEventArgs(CalendarRendererEventArgs original, CalendarDay day)
     : base(original)
 {
     _day = day;
 }
 public CalendarRendererItemEventArgs(CalendarRendererEventArgs original, CalendarItem item)
     : base(original)
 {
     _item = item;
 }
 public CalendarRendererBoxEventArgs(CalendarRendererEventArgs original, Rect bounds)
     : this(original)
 {
     Bounds = bounds;
 }