ScheduleListDataSource slds = new ScheduleListDataSource();
slds.AppointmentItemsSource = Duties;
slds.ResourceItemsSource = Owners;
slds.AppointmentPropertyMappings.Add(
new AppointmentPropertyMapping()
{
Property = AppointmentProperty.Start,
DataObjectPropertyName = nameof(Duty.DutyStartTime)
});
slds.AppointmentPropertyMappings.Add(
new AppointmentPropertyMapping()
{
Property = AppointmentProperty.End,
DataObjectPropertyName = nameof(Duty.DutyEndTime)
});
slds.AppointmentPropertyMappings.Add(
new AppointmentPropertyMapping()
{
Property = AppointmentProperty.Subject,
DataObjectPropertyName = nameof(Duty.DutyShortName)
});
slds.AppointmentPropertyMappings.Add(
new AppointmentPropertyMapping()
{
Property = AppointmentProperty.Description,
DataObjectPropertyName = nameof(Duty.DutyLongName)
});
slds.AppointmentPropertyMappings.Add(
new AppointmentPropertyMapping()
{
Property = AppointmentProperty.Location,
DataObjectPropertyName = nameof(Duty.DutyPlace)
});
slds.AppointmentPropertyMappings.Add(
new AppointmentPropertyMapping()
{
Property = AppointmentProperty.Id,
DataObjectPropertyName = nameof(Duty.DutyId)
});
slds.AppointmentPropertyMappings.Add(
new AppointmentPropertyMapping()
{
Property = AppointmentProperty.ResourceId,
DataObjectPropertyName = nameof(Duty.OwnerId)
});
slds.ResourcePropertyMappings.Add(
new ResourcePropertyMapping()
{
Property = ScheduleResourceProperty.DisplayName,
DataObjectPropertyName = nameof(Owner.OwnerName)
});
slds.ResourcePropertyMappings.Add(
new ResourcePropertyMapping()
{
Property = ScheduleResourceProperty.ColorScheme,
DataObjectPropertyName = nameof(Owner.OwnerSpecificColor)
});
slds.ResourcePropertyMappings.Add(
new ResourcePropertyMapping()
{
Property = ScheduleResourceProperty.Id,
DataObjectPropertyName = nameof(Owner.OwnerId)
});