Skip to main content
A newer version of this page is available. .

ResourceStorage Class

Represents a storage which holds appointment resources.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v19.2.dll

Declaration

public class ResourceStorage :
    ResourceStorageBase,
    IResourceStorage,
    IResourceStorageBase,
    IPersistentObjectStorage<Resource>,
    IBatchUpdateable,
    IDisposable,
    IFilteredComponent,
    IFilteredComponentBase

The following members return ResourceStorage objects:

Remarks

Appointments in the XtraScheduler control can be associated with resources. A resource is an object which exposes the Resource interface. It has the following attributes: a unique identifier, caption, color and image.

The XtraScheduler control allows appointments to be grouped by resources. Use the SchedulerControl.GroupType property to specify the required group mode.

The ResourceStorage class represents a storage which holds resources. The functionality of the ResourceStorage class can be accessed via the SchedulerStorage.Resources property. To get the collection of resources use the ResourceStorageBase.Items property.

To associate a resource with an appointment this resource should be added to the ResourceStorage object and then bound to the appointment via the Appointment.ResourceId property. It represents a resource ID specified by the IPersistentObject.Id property.

Connecting the ResourceStorage object to a data source via the PersistentObjectStorage<T>.DataSource and PersistentObjectStorage<T>.DataMember properties enables bound mode. In this mode, if the PersistentObjectStorage<T>.AutoReload property is set to true resources are automatically retrieved from the specified data source and added to the ResourceStorage object, and when data in the data source is modified the ResourceStorage object automatically reloads the data. If the AutoReload property is set to false data is not automatically loaded and reloaded from the data source. You should use the SchedulerStorageBase.RefreshData method to reload data manually in this case.

Use the ResourceStorage.Mappings property to specify which fields in the bound data source hold a resource’s caption, color and ID. The values of these fields will be synchronized with the corresponding properties of Resource objects.

Appointments for the scheduler control are stored in the AppointmentStorage object. In bound mode, appointments are retrieved from and stored back to a data source specified by the DataSource and DataMember properties of the AppointmentStorage object. This data source may contain a field which holds the resource ID’s of appointments. To enable the resource ID’s to be automatically retrieved from the database, set the AppointmentMappingInfo.ResourceId property to the name of this field.

In unbound mode (when the ResourceStorage object is not bound to a data source) you can use the ResourceStorageBase.Items property to populate the storage with resources manually.

See Also