Back to Devexpress

SchedulerDataStorage.Resources Property

windowsforms-devexpress-dot-xtrascheduler-dot-schedulerdatastorage-77d8915a.md

latest7.9 KB
Original Source

SchedulerDataStorage.Resources Property

Gets the object which manages resources for appointments.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public ResourceDataStorage Resources { get; }
vb
Public ReadOnly Property Resources As ResourceDataStorage

Property Value

TypeDescription
ResourceDataStorage

A ResourceStorage object which manages resources for appointments.

|

Remarks

Appointments can be associated with resources. A resource is an object which has the following attributes: a unique identifier, caption, color and an image. Consider an application which schedules rooms in a hotel. In this application hotel rooms can be represented as resources which can be occupied by tourists.

The Resources property maintains a collection of resources for appointments. You can load resources from a data source by specifying the DataMember and DataSource properties of the ResourcesStorage object. Or you can populate the collection manually by adding items via the ResourceStorageBase.Items property.

Each item in the collection is an object which exposes the Resource interface.

In bound mode, the XtraScheduler control obtains information on appointments from a database which is specified by the DataMember and DataSource properties of the SchedulerDataStorage.Appointments object. In this mode resources from the Resources collection can be associated with the appointments via the AppointmentMappingInfo.ResourceId property.

In unbound mode, resources can be associated with appointments manually via the Appointment.ResourceId property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Resources property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-scheduler-manage-resources-runtime/CS/SchedulerResourcesManagement/Form1.cs#L107

csharp
schedulerControl1.ActiveView.FirstVisibleResourceIndex = Math.Max(0, schedulerStorage1.Resources.Count - schedulerControl1.ActiveView.ResourcesPerPage);
    schedulerControl1.Services.Selection.SelectedResource = schedulerStorage1.Resources[schedulerStorage1.Resources.Count - 1];
}

winforms-scheduler-optimize-performance-large-dataset/CS/FetchAppointmentExample/Form1.cs#L44

csharp
for (int i = 0; i < schedulerControl1.ActiveView.ResourcesPerPage; i++) {
    resourcesVisible.Add(schedulerDataStorage1.Resources[schedulerControl1.ActiveView.FirstVisibleResourceIndex + i]);
}

winforms-scheduler-formatting-services/CS/FormattingServicesExample/Data/Data.cs#L63

csharp
for(int i = 0; i < count; i++) {
    Resource resource = schedulerStorage1.Resources[participants[i]];
    description += String.Format("{0}\r\n", resource.Caption);

winforms-scheduler-linq-to-sql/CS/XtraScheduler_LINQ/Form1.cs#L24

csharp
AppointmentDataStorage aptStorage = this.schedulerStorage1.Appointments;
ResourceDataStorage resStorage = this.schedulerStorage1.Resources;

winforms-scheduler-bind-to-custom-objects/CS/CustomObjectsBinding/Form1.cs#L81

csharp
for (int i = 0; i < count; i++) {
    Resource resource = schedulerDataStorage1.Resources[i];
    string subjPrefix = resource.Caption + "'s ";

winforms-scheduler-manage-resources-runtime/VB/SchedulerResourcesManagement/Form1.vb#L110

vb
schedulerControl1.ActiveView.FirstVisibleResourceIndex = Math.Max(0, schedulerStorage1.Resources.Count - schedulerControl1.ActiveView.ResourcesPerPage)
    schedulerControl1.Services.Selection.SelectedResource = schedulerStorage1.Resources(schedulerStorage1.Resources.Count - 1)
End Sub

winforms-scheduler-optimize-performance-large-dataset/VB/FetchAppointmentExample/Form1.vb#L42

vb
For i As Integer = 0 To schedulerControl1.ActiveView.ResourcesPerPage - 1
    resourcesVisible.Add(schedulerDataStorage1.Resources(schedulerControl1.ActiveView.FirstVisibleResourceIndex + i))
Next

winforms-scheduler-formatting-services/VB/FormattingServicesExample/Data/Data.vb#L55

vb
For i As Integer = 0 To count - 1
    Dim resource As Resource = schedulerStorage1.Resources(participants(i))
    description += String.Format("{0}" & Microsoft.VisualBasic.Constants.vbCrLf, resource.Caption)

winforms-scheduler-linq-to-sql/VB/XtraScheduler_LINQ/Form1.vb#L27

vb
Dim aptStorage As AppointmentDataStorage = schedulerStorage1.Appointments
Dim resStorage As ResourceDataStorage = schedulerStorage1.Resources
aptStorage.Mappings.AllDay = "AllDay"

winforms-scheduler-bind-to-custom-objects/VB/CustomObjectsBinding/Form1.vb#L84

vb
For i As Integer = 0 To count - 1
    Dim resource As Resource = SchedulerDataStorage1.Resources(i)
    Dim subjPrefix As String = resource.Caption & "'s "

See Also

SchedulerDataStorage Class

SchedulerDataStorage Members

DevExpress.XtraScheduler Namespace