Skip to main content

Business Objects

  • 3 minutes to read

The Scheduler can be bound to a collection of custom objects. This document contains a brief overview of collection types and contains an example of code that is used to implement appointment and resource objects.

A Scheduler Storage can be bound to a System.ComponentModel.BindingList<T> class instance (a generic collection that supports data binding), or a System.Collections.ObjectModel.ObservableCollection<T> class instance (a dynamic data collection that provides notifications). When you consider the type of item to use in a collection, make sure that its properties can be mapped to the Scheduler Storage fields in a straightforward way (i.e., the property value type must correspond to the data type used in the mapping). This rule prohibits the use of the System.Collections.ObjectModel.ObservableCollection<Appointment> collection as the data source because the mapping AppointmentMappingInfo.RecurrenceInfo requires a mapped field of type string, not the RecurrenceInfo data type. Review the code snippet below for information on data types required for specific mappings.

The following code demonstrates how to implement appointment and resource objects.

View Example

public class CustomAppointment
{
    public DateTime StartTime { get; set; }
    public DateTime EndTime { get; set; }
    public string Subject { get; set; }
    public int Status { get; set; }
    public string Description { get; set; }
    public int Label { get; set; }
    public string Location { get; set; }
    public bool AllDay { get; set; }
    public int EventType { get; set; }
    public string RecurrenceInfo { get; set; }
    public string ReminderInfo { get; set; }
    public object OwnerId { get; set; }
}
public class CustomResource {
    public string Name { get; set; }
    public int ResID { get; set; }
    public Color ResColor { get; set; }
    // Set the SchedulerStorage.Resources.ColorSaving property to ColorSavingType.Color to display resources using the specified color. 
}

Note

Do not implement a property in your custom object that returns a collection. You should instead implement a container class that has a property to get and set the collection, and use this class in the corresponding custom object property instead.