ComponentOne Scheduler for WinForms
Adding Resources to the Master Resource List
Working with Scheduler for WinForms > Appointments > Resources > Adding Resources to the Master Resource List

Scheduler for WinForms supports resources created in code or at run time through the Master Resource List dialog box. The following code, added to the Form_Load event, creates a Digital Projector resource:

To write code in Visual Basic

Visual Basic
Copy Code
' Create the Digital Projector resource.        
Dim rescol As C1.C1Schedule.ResourceCollection        
rescol = Me.C1Schedule1.DataStorage.ResourceStorage.Resources        
Dim roomres As New C1.C1Schedule.Resource        
roomres.Text = "Digital Projector"
   
' Insert the resource into the Master Resource List.        
rescol.Insert(0, roomres)

To write code in C#

C#
Copy Code
// Create the Digital Projector resource.        
C1.C1Schedule.ResourceCollection rescol;         
rescol = this.c1Schedule1.DataStorage.ResourceStorage.Resources;         
C1.C1Schedule.Resource roomres = new C1.C1Schedule.Resource();         
roomres.Text = "Digital Projector"; 
  
// Insert the resource into the Master Resource List.        
rescol.Insert(0, roomres);

At run time, creating a resource or resources can be done through the Master Resource List dialog box. Clicking the Master Resource List button in the Resources dialog box opens the Master Resource List dialog box where you add or remove resources.

After you create a resource or resources, add the resource to the appointment in the Resources dialog box. For more details how to add a resource to an appointment, see Assigning Resources to an Appointment.