[]
        
(Showing Draft Content)

C1.Win.Schedule.C1Schedule.BeforeTimeFormat

BeforeTimeFormat Event

Occurs before the time interval is formatted.

Namespace: C1.Win.Schedule
Assembly: C1.Win.Schedule.8.dll
Syntax
public event EventHandler<BeforeTimeFormatEventArgs> BeforeTimeFormat
Returns
Type Description
EventHandler<BeforeTimeFormatEventArgs> Occurs before the time interval is formatted.
Remarks

Use this event to alter default time interval appearance. For example, to display different working hours for different days.

Examples

This sample shows how to alter time interval appearance depending on BeforeTimeFormatEventArgs properties.

private void c1Schedule1_BeforeTimeFormat(object sender, BeforeTimeFormatEventArgs e)
{
if (e.Start.TimeOfDay == TimeSpan.FromMinutes(120))
{
e.WorkTime = true;
if (e.Start.DayOfWeek == DayOfWeek.Sunday)
{
e.Background = Color.Red;
}
}
else if (e.Start.TimeOfDay == TimeSpan.FromMinutes(240) &&  e.Start.DayOfWeek != DayOfWeek.Sunday)
{
e.Background = c1Schedule1.Theme.Palette.FreeHourBorder;
}
else
{
if (e.Start.DayOfWeek == DayOfWeek.Sunday && e.Duration.TotalDays == 1)
{
e.Background = Color.Navy;
}
}
}