A resource is a keyword or a phrase that defines a source of support for a particular task. Resources, which are stored in the ResourceCollection class, are optional and an appointment can have one or more resources assigned to it.
Scheduler supports resources created at run time through the Resources dialog box and programmatically as well. Once added to the list, the resource can be assigned to an appointment.
The new resource appears in the Resources dialog box when the Resources button is clicked in the Appointment dialog box:
To add a resource at run time:
To add resources programmatically, use the following code:
C# |
Copy Code
|
---|---|
ObservableCollection<string> resources = new ObservableCollection<string>(); private void Add_Resources(object sender, RoutedEventArgs e) { resources.Add("Venue"); resources.Add("Speakers"); resources.Add("Document"); resources.Add("Event"); resources.Add("Presentation"); resources.Add("Mentor"); resources.Add("Idea"); resources.Add("Budgeting"); resources.Add("Fund Raising"); resources.Add("Feedback"); foreach (string resource in resources) { Resource res = new Resource(); res.MenuCaption = resource; if (!sched1.DataStorage.ResourceStorage.Resources.Any(x => x.MenuCaption == resource)) sched1.DataStorage.ResourceStorage.Resources.Add(res); } } |