Nevron Open Vision Documentation
Schedule / Appointments / Appointment Categorization
In This Topic
    Appointment Categorization
    In This Topic

    Appointment categorization is the process of assigning a category and/or a time marker to the Category and TimeMarker property of the appointment respectively. The categories and time markers (also called "tags") you can choose from are defined by the Categories and TimeMarkers collections of the schedule, which owns the appointments and by default are:

    Categories
    Fill Name
    Orange
    Red
    Blue
    Green
    Purple
    Yellow
    Time Markers
    Fill Name
    Free
    Tentative
    Busy
    Out of Office

     

     Setting Category and Time Marker

    The category affects the background fill of the whole appointment, which by default is light sky blue color fill and the time marker affects the fill of the header, which is by default gray color fill. You can easily add additional categories and time markers or remove some of the default ones by modifying the Categories and TimeMarkers collection of the schedule respectively.

    Categories are represented by the NCategory class and time markers - by the NTimeMarker class, which both provide constructors with 4 parameters, you can use to create appointment tags by specifying:

    • The name of the tag.
    • The fill of the tag.
    • The highlighted fill of the tag, which specifies the fill of the tag when the mouse pointer is over the appointment.
    • The selected fill of the tag, which specifies the fill of the tag when the appointment is selected.

    The following piece of code demonstrates how to create an appointment, assign a category and a time marker to it and add it to a schedule:

    Assign category and time marker
    Copy Code
    DateTime today = DateTime.Today;
    NAppointment appointment = new NAppointment("Meeting with John", today.AddHours(8), today.AddHours(10));
    appointment.Category = NLoc.Get("Orange");
    appointment.TimeMarker = NLoc.Get("Busy");
    schedule.Appointments.Add(appointment);
    

    It is best to use NLoc.Get when dealing with appointment tag names, in order to make your application localizable. For more information about localization, check out the Localization Overview topic.

     Time Marker Thickness

    Time marker thickness is determined by the thickness of the appointment header, which is by default set to 5 DIPs (device independent pixels). You can easily change it by setting a different value to the static property AppointmentHeaderThickness of the NScheduleTheme class. This property should be set before applying the schedule theme, for example in the entry point of the application.

    The line of code below shows how to set the appointment header thickness, which also determines time marker thickness, to 30 DIPs:

    Setting appointment header thickness
    Copy Code
    NScheduleTheme.AppointmentHeaderThickness = 30;
    
    See Also