Span Planner Control

Used to design horizontal spans of various colours. Similar to a Gantt Chart, but it doesn't handle dependencies. The main thing I've done with it is to make a Day Planner:
 
It also comes with a funky Legend Control:

SpanPlanner

These are just the more interesting properties & methods.

Headers

A collection of SpanHeaders. Each of these has a BackColor (which can be Color.Empty). This BackColor is used to set up the alpha background you see above. They also have Text and Width properties.

Rows

Contains a Collection of SpanRows. These also have BackColor and Text properties. It also contains a Spans property which hosts the pretty spans you see above.

SpanTool

This contains an object that implements ISpanTool. Basically the thing that creates the spans that are added to the planner. It's a Factory class. There are two implementations of ISpanTool: ColorSpanTool and LegendSpanTool. 

Key

Contains the public key that is used to check the license and policy signatures.

BuildHourlyHeaders

Generates the headers in the screenshot.

BuildWeeklyRows

Generates the rows in the screenshot.

Span Object

Represents a span being designed. Note that when spans are overlapped they do one of two things: merge or join. A merge only happens when the spans have the same brushes and pens. The two spans are merged into one. In a join (which happens when the spans cannot merge), one span is pushed out of the way of the other.

operator explicit DateTime

Used when you created the SpanPlanner using BuildHourlyHeaders. Converts the start of the span to a DateTime (always relative to DateTime.Today).

operator explicit TimeSpan

Also used when the planner has hourly headers. This converts the duration of the Span to a TimeSpan. 

Legend Control

Contains a set of LegendItems to display. Have a look at the sample for how to interoperate the SpanPlanner with the Legend control.

 

Thanks

I wrote this code for Palantir, and they very kindly agreed to allow me to post it.