|
Schedule.NET NoDrop Areas
Schedule areas can be defined to present some type of color-coded information to
the user. For example, you may wish to define 12pm through 1pm as lunchtime and
June 3 as surgery day. You would use the NoDropAreaCollection for the first example
and the ColoredAreaCollection for the second. During lunchtime you do not want any
appointments to be scheduled. You define this time range and it is colored. If a
user tries to move an appointment over this position, it turns to a no-drop icon.
In the second example, surgery, you wish to define a day to schedule surgeries.
Here you want to color-code the schedule but you do want appointments to be scheduled
there.
The following code demonstrates how to add to two examples above.
|
'Define lunchtime for every day
Schedule1.NoDropAreaCollection.Add(Color.Red, #12:00:00 PM#, 60)
'Define surgeries for 6/3/2004
Schedule1.ColoredAreaCollection.Add(Color.LightBlue, #6/3/2004#)
|
The entire functionality of these two collections lies in their Add methods. Once
an object is created it cannot be modified only removed. The Add method is overloaded
to allow many different types of areas to be defined. For example, you may wish
to define a date, date/time, date/room, room/time, etc. Use the Add method that
matches the information need to define your area.
The code snippet above creates the schedule areas in the above screen shot. Notice
that the restricted areas defined by the NoDropAreaCollection are displayed on top
of the colored areas defiend by thee ColoredAreaCollection. This will always be
the case. The order of drawing is the schedule grid, column and row headers, ColoredAreaCollection,
NoDropAreaCollection, and finally Appointments. The drawing order defines which
objects or areas are overlapped.
|
|