private void schedulerControl1_CustomDrawTimeCell(object sender, CustomDrawObjectEventArgs e)
        {
            SelectableIntervalViewInfo obj = e.ObjectInfo as SelectableIntervalViewInfo;

            if (obj != null)
            {
                e.DrawDefault();

                if (obj.Resource.Id is Guid)
                {
                    Ingresso ingresso = obj.Resource.GetSourceObject(this.schedulerStorage1) as Ingresso;
                    if (ingresso != null && ingresso.VerificaCalendario)
                    {
                        if (calendario == null)
                        {
                            calendario = new XPCollection <IngressoCalendario>(this.session1);
                        }

                        int numero = 0;
                        if (Trova(ingresso, obj.Interval.Start, out numero))
                        {
                            e.Graphics.DrawString(numero.ToString(), font, brush_green, e.Bounds);
                        }
                    }
                }

                e.Handled = true;
            }
        }
Пример #2
0
        private void schedulerControl1_CustomDrawTimeCell(object sender, CustomDrawObjectEventArgs e)
        {
            HatchBrush brickBrush            = new HatchBrush(HatchStyle.DiagonalBrick, Color.LightYellow, Color.Firebrick);
            Brush      solidBrush            = new SolidBrush(Color.Plum);
            SelectableIntervalViewInfo cells = e.ObjectInfo as SelectableIntervalViewInfo;

            if (cells != null)
            {
                if (cells.Selected)
                {
                    e.Graphics.FillRectangle(solidBrush, e.Bounds);
                    e.Handled = true;
                }
                else if (cells.Interval.Start.Day == 13)
                {
                    e.Graphics.FillRectangle(brickBrush, e.Bounds);
                    e.Handled = true;
                }
            }

            SchedulerViewCellBase cell = e.ObjectInfo as SchedulerViewCellBase;

            if (cell != null && IsHoliday(cell.Interval))
            {
                cell.Appearance.BackColor = Color.Tomato;
            }
        }
Пример #3
0
        public static void scheduler_CustomDrawTimeCell(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e)
        {
            // Get the cell to draw.
            SelectableIntervalViewInfo cell =
                e.ObjectInfo as SelectableIntervalViewInfo;

            if (cell != null)
            {
                // Draw the cell.
                Brush myBrush = (cell.Selected) ? SystemBrushes.Highlight : SystemBrushes.Window;
                e.Cache.FillRectangle(myBrush, cell.Bounds);
            }
            e.Handled = true;
        }
Пример #4
0
        private void GetTargetTime(Point pt)
        {
            SchedulerHitInfo hitInfo = schedulerControl1.ActiveView.ViewInfo.CalcHitInfo(pt, true);

            if (hitInfo.HitTest == SchedulerHitTest.Cell)
            {
                SelectableIntervalViewInfo cell = hitInfo.ViewInfo;
                targetTime = cell.Interval.Start;
            }
            else
            {
                targetTime = DateTime.MinValue;
            }
        }
Пример #5
0
        public static void scheduler_CustomDrawTimeCell_3(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e)
        {
            SelectableIntervalViewInfo cell =
                e.ObjectInfo as SelectableIntervalViewInfo;

            if (cell != null)
            {
                if (cell.Selected)
                {
                    e.Cache.FillRectangle(Brushes.Lime, e.Bounds);
                    e.Handled = true;
                }
            }
        }
        public static void scheduler_CustomDrawTimeCell_3(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e)
        {
            Brush solidBrush = new SolidBrush(Color.Lime);
            SelectableIntervalViewInfo cell =
                e.ObjectInfo as SelectableIntervalViewInfo;

            if (cell != null)
            {
                if (cell.Selected)
                {
                    e.Graphics.FillRectangle(solidBrush, e.Bounds);
                    e.Handled = true;
                }
            }
        }
        // Add a new appointment initialized with Car data.
        private void DoDrop(Point point, CarDragData data)
        {
            SchedulerHitInfo hitInfo =
                schedulerControl1.ActiveView.ViewInfo.CalcHitInfo(point, true);

            if (hitInfo.HitTest == SchedulerHitTest.Cell)
            {
                // Obtain the time interval view info.
                SelectableIntervalViewInfo cell = hitInfo.ViewInfo;

                // Add an appointment.
                Appointment apt = schedulerStorage1.CreateAppointment(AppointmentType.Normal, cell.Interval.Start, TimeSpan.FromHours(4));
                apt.Subject     = data.Model;
                apt.Description = data.Description;
                schedulerStorage1.Appointments.Add(apt);
            }
        }
Пример #8
0
        private void schedulerControl1_CustomDrawTimeCell(object sender, CustomDrawObjectEventArgs e)
        {
            SelectableIntervalViewInfo viewInfo = e.ObjectInfo as SelectableIntervalViewInfo;
            SchedulerViewCellBase      cell     = e.ObjectInfo as SchedulerViewCellBase;
            DateTime CurrentDt = viewInfo.Interval.Start;

            if (viewInfo.Selected)
            {
                //e.Cache.FillRectangle(SystemBrushes.Highlight, cell.Bounds);
                e.Handled = false;
            }
            else
            {
                if (CheckDateIsWorkDay(CurrentDt))
                {
                    Color _ShowColor = Color.LightCyan;
                    if (Convert.ToBoolean(CurrentDt.Month % 2))
                    {
                        _ShowColor = Color.LightBlue;
                    }
                    FillGradient(e.Cache, cell.Bounds, _ShowColor, _ShowColor, 45);
                    FillGradient(e.Cache, cell.ContentBounds, _ShowColor, _ShowColor, 45);
                    FillGradient(e.Cache, cell.TopBorderBounds, Color.Gray, Color.Gray, 45);
                    FillGradient(e.Cache, cell.RightBorderBounds, Color.Gray, Color.Gray, 45);
                    FillGradient(e.Cache, cell.LeftBorderBounds, Color.Gray, Color.Gray, 45);
                    FillGradient(e.Cache, cell.BottomBorderBounds, Color.Gray, Color.Gray, 45);
                    e.Handled = true;
                }
                else
                {
                    Color _ShowColor = Color.MistyRose;
                    if (Convert.ToBoolean(CurrentDt.Month % 2))
                    {
                        _ShowColor = Color.PeachPuff;
                    }
                    FillGradient(e.Cache, cell.Bounds, _ShowColor, _ShowColor, 45);
                    FillGradient(e.Cache, cell.ContentBounds, _ShowColor, _ShowColor, 45);
                    FillGradient(e.Cache, cell.TopBorderBounds, Color.Gray, Color.Gray, 45);
                    FillGradient(e.Cache, cell.RightBorderBounds, Color.Gray, Color.Gray, 45);
                    FillGradient(e.Cache, cell.LeftBorderBounds, Color.Gray, Color.Gray, 45);
                    FillGradient(e.Cache, cell.BottomBorderBounds, Color.Gray, Color.Gray, 45);
                    e.Handled = true;
                }
            }
        }
Пример #9
0
        private void schedulerControlPrenotazioni_CustomDrawTimeCell(object sender, CustomDrawObjectEventArgs e)
        {
            SelectableIntervalViewInfo obj = e.ObjectInfo as DevExpress.XtraScheduler.Drawing.SelectableIntervalViewInfo;

            if (obj != null)
            {
                e.DrawDefault();

                if (m_ActiveControl != null && m_ActiveControl.Ingresso.CodicePrevent > 0 && m_ActiveControl.Ingresso.Prenotazione != EnumPrenotazioneIngresso.NonGestita)
                {
                    RisultatoCalendario ris = GestoreCalendario.GeneraRichiesta(obj.Interval.Start, m_ActiveControl.Ingresso.CodicePrevent);

                    if (ris != null)
                    {
                        int numero = ris.PostiDisponibili;

                        if (obj.Selected)
                        {
                            e.Graphics.DrawString(numero.ToString(), font, brush_white, e.Bounds);
                        }
                        else
                        {
                            e.Graphics.DrawString(numero.ToString(), font, brush_green, e.Bounds);
                        }

                        if (numero > 0)
                        {
                            // int massimo = Math.Max(numero, m_ActiveControl.Ingresso.CapacitaSlot(GestoreCalendario.TipoGS));
                            int massimo = Math.Max(numero, ris.MaxPostiDisponibili);
                            e.Graphics.DrawLine(pen_green, e.Bounds.X + 1, e.Bounds.Y + 16, e.Bounds.X + e.Bounds.Width * numero / massimo - 1, e.Bounds.Y + 16);
                        }
                    }
                }

                e.Handled = true;
            }
        }