At run time, assigning a category or multiple categories to an appointment can be done through the Categories dialog box. By default, there is a list of twenty predefined categories. For more information on how to add categories to the Categories dialog box, see Add Categories to the Categories List.
The categories appears next in the Categories text box as shown in the following image.
To assign a category to an appointment at run time:
To assign a category to an appointment programmatically, use the following code:
C# |
Copy Code
|
---|---|
//Create Appointments Appointment app = new Appointment(DateTime.Now.Date, DateTime.Now.Date.AddDays(1)); app.Subject = "Meeting"; sched1.DataStorage.AppointmentStorage.Appointments.Add(app); //Add new Categories to the CategoryList sched1.DataStorage.CategoryStorage.Categories.Add(new Category() { MenuCaption = "Conference" }); sched1.DataStorage.CategoryStorage.Categories.Add(new Category() { MenuCaption = "Video Call" }); sched1.DataStorage.CategoryStorage.Categories.Add(new Category() { MenuCaption = "Interview" }); sched1.DataStorage.CategoryStorage.Categories.Add(new Category() { MenuCaption = "Games" }); var appointment = sched1.DataStorage.AppointmentStorage.Appointments.First(x => x.Start == DateTime.Now.Date); var categoryList = sched1.DataStorage.CategoryStorage.Categories; appointment.Categories.Add(categoryList.First(x => x.MenuCaption == "Conference")); appointment.Categories.Add(categoryList.First(x => x.MenuCaption == "Video Call")); |