private void dayViewTimeCells1_CustomDrawTimeCell(object sender, CustomDrawObjectEventArgs e) { TimeCell cell = (TimeCell)e.ObjectInfo; Rectangle rect = e.Bounds; rect.Height = 1; rect.Offset(0, rect.Height - 1); e.Cache.DrawRectangle(Pens.Gray, rect); if (cell is ExtendedCell) { SchedulerColorSchema schema = this.GetResourceColorSchema(cell.Resource); cell.Appearance.BackColor = Color.White; cell.Appearance.BackColor2 = schema.CellLight; e.DrawDefault(); } else { using (StringFormat sf = new StringFormat()) { sf.Alignment = StringAlignment.Far; rect = cell.Bounds; rect.Inflate(-10, 0); e.Cache.DrawString(cell.Interval.Start.ToShortTimeString(), e.Cache.GetFont(cell.Appearance.Font, FontStyle.Regular), e.Cache.GetSolidBrush(Color.Gray), rect, sf); } } e.Handled = true; }
private void dayViewTimeCells1_CustomDrawDayViewAllDayArea(object sender, CustomDrawObjectEventArgs e) { AllDayAreaCell cell = (AllDayAreaCell)e.ObjectInfo; SchedulerColorSchema schema = this.GetResourceColorSchema(cell.Resource); cell.Appearance.BackColor = schema.Cell; cell.Appearance.BackColor2 = schema.CellBorder; }
private void horizontalResourceHeaders1_CustomDrawResourceHeader(object sender, CustomDrawObjectEventArgs e) { ResourceHeader header = (ResourceHeader)e.ObjectInfo; SchedulerColorSchema schema = this.GetResourceColorSchema(header.Resource); header.Appearance.HeaderCaption.BackColor = schema.CellLight; header.Appearance.HeaderCaption.BackColor2 = schema.Cell; Color color = schema.CellBorderDark; header.Appearance.HeaderCaption.ForeColor = TransformColor(color, 0.6); header.Appearance.HeaderCaption.Font = e.Cache.GetFont(header.Appearance.HeaderCaption.Font, FontStyle.Bold); e.DrawDefault(); e.Handled = true; }