Exemple #1
0
        void CustomDrawAppointmentFlyoutSubject(CustomDrawAppointmentFlyoutSubjectEventArgs e)
        {
            AppointmentBandDrawerViewInfoBase viewInfo = (AppointmentBandDrawerViewInfoBase)e.ObjectInfo;

            e.DrawBackgroundDefault();
            CustomDrawAppointmentFlyoutSubject(e.Appointment, viewInfo);
        }
Exemple #2
0
        Rectangle GetSubjectBounds(AppointmentBandDrawerViewInfoBase viewInfo)
        {
            Rectangle bounds = viewInfo.Bounds;

            if (viewInfo.View.Status.Type == AppointmentStatusType.Free)
            {
                bounds.Offset(0, 10);
            }
            return(bounds);
        }
Exemple #3
0
        Rectangle GetStatusBounds(AppointmentBandDrawerViewInfoBase viewInfo)
        {
            Rectangle bounds = Rectangle.Inflate(viewInfo.Bounds, -1, -1);

            if (viewInfo.View.Status.Type == AppointmentStatusType.Free)
            {
                bounds.Height = 20;
            }
            else
            {
                bounds.Height = 5;
            }
            return(bounds);
        }
Exemple #4
0
        void CustomDrawAppointmentFlyoutSubject(Appointment appointment, AppointmentBandDrawerViewInfoBase viewInfo)
        {
            GraphicsCache cache        = viewInfo.Cache;
            StringFormat  stringFormat = new StringFormat(viewInfo.View.Appearance.GetStringFormat());

            stringFormat.Alignment = stringFormat.LineAlignment = StringAlignment.Center;
            try {
                // Draw status
                Rectangle statusRect = GetStatusBounds(viewInfo);
                cache.FillRectangle(viewInfo.View.Status.GetBrush(), statusRect);

                if (viewInfo.View.Status.Type == AppointmentStatusType.Free)
                {
                    // Draw a warning
                    cache.DrawImage(GetWarningIcon(new Size(statusRect.Height, statusRect.Height)), statusRect.Location);
                    cache.DrawString("Status is unacceptable", fontStorage.StatusFont, Brushes.Red, statusRect, stringFormat);
                }
                // Draw subject
                cache.DrawString(appointment.Subject, fontStorage.SubjectFont, Brushes.Black, GetSubjectBounds(viewInfo), stringFormat);
            }
            finally {
                stringFormat.Dispose();
            }
        }