Nevron Open Vision Documentation
Schedule / Schedule / Schedule View
In This Topic
    Schedule View
    In This Topic
     Structure and Navigation

    The schedule view consists of the following parts (exposed through the same name properties):

    • Navigator - lets the user change the currently viewed date range of the schedule.
    • HScrollBar - the horizontal scrollbar of the schedule view. Shown if the schedule is wider than the area of the schedule view.
    • VScrollBar - the vertical scrollbar of the schedule view. Shown if the schedule is taller than the area of the schedule view.
    • Schedule - the schedule shown in the schedule view.

    The schedule view exposes two useful public properties, which allows you navigate back and forth in time via code in the same way the user can navigate when clicking the navigator buttons:

    • ShowPreviousViewRange() - shows the previous range of the schedule view.
    • ShowNextViewRange() - shows the next range of the schedule view.
     Loading Documents

    The schedule view (NScheduleView) inherits the base class of all document views (NDocumentView), which means that you instantly get access to the methods of this class for saving and loading document to stream and file. The most commonly used methods for loading a schedule document are:

    • LoadNewDocument() - create a new document and assigns it to the document view.
    • LoadFromFile() - the parameterless load from file method shows an Open File Dialog for choosing a schedule document to load.
    • LoadFromFile(string fileName) - loads a schedule document from the given file.
    • LoadFromStream(Stream stream) - loads a schedule document from the given stream.

    The following example demonstrates how to load a schedule document from a file:

    Loading a schedule document
    Copy Code
    scheduleView.LoadFromFile(@"C:\Documents\schedule.ndx");
    
     Saving Documents

    Besides load methods, the schedule view inherits several save methods from the NDocumentView, too. The most commonly used of them are:

    • SaveToFile() - the parameterless save to file method show a Save File Dialog for choosing the file in which to save the current schedule document.
    • SaveToFile(string fileName) - saves the current schedule document to the file with the given name.
    • SaveToStream(Stream stream) - saves the current schedule document to the given stream.

    The following example demonstrates how to save a schedule to a file:

    Saving a schedule document
    Copy Code
    scheduleView.SaveToFile(@"C:\Documents\schedule.ndx");
    
     Document Formats

    Nevron Schedule supports the following schedule document formats:

    • Nevron Binary Schedule Format (*.nsb) - a binary based Nevron Schedule format. This format preserves all formatting and settings and provides great loading and saving performance. This is the default format for saving and loading of Schedule documents.
    • Nevron XML Schedule Format (*.nsx) - a XML based Nevron Schedule format. This format also preserves all formatting and settings and is backward compatible with older versions of the Nevron Schedule component.
    • iCalendar Format (*.ics) - a popular schedule format supported by a large number of products, including Google Calendar, Apple Calendar (formerly iCal), IBM Lotus Notes, Yahoo! Calendar, eM Client, Lightning extension for Mozilla Thunderbird and SeaMonkey, and partially by Microsoft Outlook and Novell GroupWise. This format is preferred when you should export or import appointment data to and from third party schedule applications. Note that it may not preserve all formatting and settings you apply to your schedule and appointments, because it does not support all features Nevron Schedule offers.
     Tools and Interactivity

    The Nevron Schedule View provides rich interactivity features, including:

    • Moving appointments - users can drag appointments to change their start and end time, as well as the group and group item they are associated with.
    • Resizing appointments - users can drag the start or the end of an appointment to change its duration.
    • Editing appointments - when an appointment is double clicked an appointment editor opens.
    • Snapping - if enabled makes the appointments snap to the ticks of the time ruler when moved or resized.

    You can enable or disable any of these interactivity features by setting a mask value to the schedule's Interactivity property. For example to enable only moving and editing of appointments, you can use the following line of code:

    Schedule interactivity
    Copy Code
    schedule.Interactivity = ENScheduleInteractivity.Move | ENScheduleInteractivity.Edit;
    

    If you want to customize the interactivity features of the schedule even further, you should modify its tools. Tools can be obtained by calling the GetTool(NSchema toolSchema) of the schedule's Interactor. When you get a tool, you can use its Enabled property to enable/disable it. The following example demonstrates how to disable the appointment edit tool, which shows an appointment editor when the user double clicks an appointment or an empty grid cell.

    Disabling a schedule tool
    Copy Code
    NTool tool = schedule.Interactor.GetTool(NAppointmentEditTool.NAppointmentEditToolSchema);
    tool.Enabled = false;
    

    Some tools contain properties, which lets you control their behavior. For example, if you want to make the right mouse button select appointments, you should change the MouseButtonEvent property of the click select tool as follows:

    Click select tool modification
    Copy Code
    NScheduleClickSelectTool clickSelectTool = (NScheduleClickSelectTool)schedule.Interactor.GetTool(
        NScheduleClickSelectTool.NScheduleClickSelectToolSchema);
    clickSelectTool.MouseButtonEvent = ENMouseButtonEvent.RightButtonDown;
    
    See Also