TaskBoard
A task board: a plan's work as cards in status columns, optionally split into lanes by assignee, category or phase, moved by dragging or entirely from the keyboard.
public partial class TaskBoard : Control
Inherits from / implements: Control
Remarks
A column is a value of Status, and a lane a value of the field LaneBy names. Moving a card changes those fields and the task's Rank, after offering the move as the cancelable CardMoving event. Summary tasks are structure, not work, and are not cards. Keyboard: the arrows move between cards; Space picks the current card up, the arrows then carry it (Shift with Up or Down between lanes), and Space or Enter drops it or Escape puts it back. Enter or a double-click raises TaskActivated.
Members at a glance
TaskBoard | Creates an empty board. Give it Tasks, and Columns for a workflow of its own; without columns, the statuses the tasks use are the columns. |
CardBackColor | The fill of a card. Empty follows BackColor. |
CardBorderColor | The border of a card. Empty is a shade between BackColor and ForeColor. |
CardHeight | The height of a card, in logical units. Never less than 48. |
ColumnBackColor | The fill of a column behind its cards. Empty is a faint shade of ForeColor over BackColor. |
ColumnWidth | The width of a column, in logical units (1/96 inch). Never less than 180. |
Columns | The columns, in order. Empty uses the statuses the tasks have, in the order they first appear. A task whose status has no column is shown in the first column. |
CriticalColor | The stripe down the side of a card whose task is on the critical path. |
Holidays | Dates that are not worked. Never null: setting null gives an empty collection. An observable collection is watched. |
LaneBy | What the board is split into lanes by. None gives one lane: just columns. |
Links | The links between tasks, which decide each card's dates and whether it is critical. Never null: setting null gives an empty collection. |
OverLimitColor | The count of a column holding more cards than its limit, and the mark over its heading. |
ProgressColor | The thin bar along the bottom of a card that shows how far the task has got. |
ProjectStart | The first day work can happen. Null uses the earliest planned start in the plan. |
ReadOnly | Whether the reader is prevented from moving cards. Selection, navigation and TaskActivated still work, and so does MoveCard, which is the application's own call. |
SelectedTask | The task whose card is selected, or null when none is. Setting a task that has no card - a summary, or a task not in the plan - clears the selection. |
ShowCriticalPath | Whether a card on the critical path carries a stripe in CriticalColor. |
StrictLimits | Whether a card is refused by a column already holding as many cards as its Limit. Off, a column may pass its limit and says so in red. |
Tasks | The tasks, as a flat list with parent references. Never null: setting null gives an empty collection. Summary tasks are not cards. |
Today | The date the charts treat as today; null for the computer's date. |
WorkingWeek | The days of the week that are worked. |
CreateAccessibilityInstance | Creates the accessible object that presents the columns and cards to assistive technology. |
Dispose | Stops watching the plan and releases the fonts, the timer and the tooltip. |
EnsureSchedule | The plan as last scheduled: every task's dates and float, the critical path, and anything in the input that could not be used. Scheduled again first when something has changed. |
IsInputKey | Makes the arrows, Home, End and the page keys the board's own; Enter too when there is a card to act on, and Escape while a card is carried, so a dialog's default and cancel buttons keep them otherwise. |
MoveCard | Moves a card as though the reader had: the move is refused by a full column when StrictLimits is on, offered as CardMoving, applied to the task, and followed by CardMoved. It is made even when ReadOnly is set, which only stops the reader. Source is Application. |
OnCardMoved | Raises CardMoved. |
OnCardMoving | Raises CardMoving. |
OnDpiChangedAfterParent | Rebuilds everything measured in device pixels when the board moves to a display with a different scale: the fonts, the scroll bars and the scroll range. |
OnFontChanged | Rebuilds the fonts the cards are written in. |
OnGotFocus | Redraws the focus cue and says which card has the focus. |
OnHandleCreated | Fits the scroll bars once the window exists, when the display's scale is first known for certain. |
OnHandleDestroyed | Forgets a refresh posted to a window that is going away; the next window posts again. |
OnKeyDown | The keys: arrows move between cards (Navigate), Space picks the current card up, Enter activates it; while a card is carried, the arrows move it, Space or Enter drops it and Escape puts it back. |
OnLostFocus | Puts a carried card back - the keys that would drop it are going elsewhere - and removes the focus cue. |
OnMouseCaptureChanged | Puts a dragged card back if the mouse is taken away mid-drag, by a message box or a switch of window. After an ordinary drop there is nothing left to put back. |
OnMouseDoubleClick | A double-click on a card raises TaskActivated. |
OnMouseDown | A press selects a card and may begin a drag; a press while a card is carried from the keyboard puts it back. |
OnMouseLeave | Hides the tooltip when the pointer leaves. |
OnMouseMove | Moves a dragged card, or keeps the tooltip on the card under the pointer. |
OnMouseUp | Drops a dragged card. |
OnMouseWheel | The wheel scrolls the lanes, sideways with Shift; a dragged card follows. |
OnPaint | Paints the board. Never throws: a fault is reported and the paint abandoned. |
OnResize | Fits the scroll bars and the view to the new size. |
OnRightToLeftChanged | Mirrors the board when the reading direction changes. |
OnScheduleChanged | Raises ScheduleChanged. |
OnSelectedTaskChanged | Raises SelectedTaskChanged. |
OnTaskActivated | Raises TaskActivated. |
Reschedule | Schedules the plan and lays the board out again now, and raises ScheduleChanged. Needed after changing a plain list or a column in place. |
ScrollToTask | Scrolls the board until a task's card is in view. Does nothing for a task that has no card. |
CardMoved | Raised after a card has moved and its task has been changed. |
CardMoving | Raised before a card moves, by a drag, a keyboard drop or MoveCard. Set Cancel to refuse the move; nothing will have changed. |
ScheduleChanged | Raised after the plan has been scheduled again because something changed: a task, a link, a collection, a calendar setting, or a call to Reschedule. |
SelectedTaskChanged | Raised when the selected card changes, by the reader or by SelectedTask. |
TaskActivated | Raised when the reader double-clicks a card or presses Enter on the selected one. |
Constructors
TaskBoard
Creates an empty board. Give it Tasks, and Columns for a workflow of its own; without columns, the statuses the tasks use are the columns.
Properties
CardBackColor
The fill of a card. Empty follows BackColor.
CardBorderColor
The border of a card. Empty is a shade between BackColor and ForeColor.
CardHeight
The height of a card, in logical units. Never less than 48.
ColumnBackColor
The fill of a column behind its cards. Empty is a faint shade of ForeColor over BackColor.
ColumnWidth
The width of a column, in logical units (1/96 inch). Never less than 180.
Columns
The columns, in order. Empty uses the statuses the tasks have, in the order they first appear. A task whose status has no column is shown in the first column.
Reschedule. The columns are the application's workflow and are set in code, like the plan itself.CriticalColor
The stripe down the side of a card whose task is on the critical path.
Holidays
Dates that are not worked. Never null: setting null gives an empty collection. An observable collection is watched.
LaneBy
What the board is split into lanes by. None gives one lane: just columns.
Links
The links between tasks, which decide each card's dates and whether it is critical. Never null: setting null gives an empty collection.
OverLimitColor
The count of a column holding more cards than its limit, and the mark over its heading.
ProgressColor
The thin bar along the bottom of a card that shows how far the task has got.
ProjectStart
The first day work can happen. Null uses the earliest planned start in the plan.
ReadOnly
Whether the reader is prevented from moving cards. Selection, navigation and TaskActivated still work, and so does MoveCard, which is the application's own call.
SelectedTask
The task whose card is selected, or null when none is. Setting a task that has no card - a summary, or a task not in the plan - clears the selection.
ShowCriticalPath
Whether a card on the critical path carries a stripe in CriticalColor.
StrictLimits
Whether a card is refused by a column already holding as many cards as its Limit. Off, a column may pass its limit and says so in red.
Tasks
The tasks, as a flat list with parent references. Never null: setting null gives an empty collection. Summary tasks are not cards.
ObservableCollection{T} or a BindingList{T} is watched, and so is every task in it. A plain list is read when it is assigned; call Reschedule after changing one.Today
The date the charts treat as today; null for the computer's date.
WorkingWeek
The days of the week that are worked.
Methods
CreateAccessibilityInstance
Creates the accessible object that presents the columns and cards to assistive technology.
Returns. The board's accessible object.
Dispose
Stops watching the plan and releases the fonts, the timer and the tooltip.
- disposing
- True when called from
Dispose.
EnsureSchedule
The plan as last scheduled: every task's dates and float, the critical path, and anything in the input that could not be used. Scheduled again first when something has changed.
IsInputKey
Makes the arrows, Home, End and the page keys the board's own; Enter too when there is a card to act on, and Escape while a card is carried, so a dialog's default and cancel buttons keep them otherwise.
- keyData
- The key, with its modifiers.
Returns. True for a key the board handles.
MoveCard
Moves a card as though the reader had: the move is refused by a full column when StrictLimits is on, offered as CardMoving, applied to the task, and followed by CardMoved. It is made even when ReadOnly is set, which only stops the reader. Source is Application.
- task
- The task whose card moves.
- status
- The column to move it to: a
Statuson the board. - lane
- The lane: an assignee or a category, or a top-level summary task's id when
LaneByisParent; empty for the lane of tasks without one; null to keep the card's lane. Ignored when the board has no lanes. - index
- Its position in the cell, from 0; clamped to the cell.
Returns. True when the card moved; false when the move was refused, cancelled, changed nothing, or named a card or column that is not on the board.
OnCardMoved
Raises CardMoved.
- e
- The task whose card moved.
OnCardMoving
Raises CardMoving.
- e
- The proposed move.
OnDpiChangedAfterParent
Rebuilds everything measured in device pixels when the board moves to a display with a different scale: the fonts, the scroll bars and the scroll range.
- e
- The event data.
OnFontChanged
Rebuilds the fonts the cards are written in.
- e
- The event data.
OnGotFocus
Redraws the focus cue and says which card has the focus.
- e
- The event data.
OnHandleCreated
Fits the scroll bars once the window exists, when the display's scale is first known for certain.
- e
- The event data.
OnHandleDestroyed
Forgets a refresh posted to a window that is going away; the next window posts again.
- e
- The event data.
OnKeyDown
The keys: arrows move between cards (Navigate), Space picks the current card up, Enter activates it; while a card is carried, the arrows move it, Space or Enter drops it and Escape puts it back.
- e
- The key data.
OnLostFocus
Puts a carried card back - the keys that would drop it are going elsewhere - and removes the focus cue.
- e
- The event data.
OnMouseCaptureChanged
Puts a dragged card back if the mouse is taken away mid-drag, by a message box or a switch of window. After an ordinary drop there is nothing left to put back.
- e
- The event data.
OnMouseDoubleClick
A double-click on a card raises TaskActivated.
- e
- The mouse data.
OnMouseDown
A press selects a card and may begin a drag; a press while a card is carried from the keyboard puts it back.
- e
- The mouse data.
OnMouseLeave
Hides the tooltip when the pointer leaves.
- e
- The event data.
OnMouseMove
Moves a dragged card, or keeps the tooltip on the card under the pointer.
- e
- The mouse data.
OnMouseUp
Drops a dragged card.
- e
- The mouse data.
OnMouseWheel
The wheel scrolls the lanes, sideways with Shift; a dragged card follows.
- e
- The mouse data.
OnPaint
Paints the board. Never throws: a fault is reported and the paint abandoned.
- e
- The paint data.
OnResize
Fits the scroll bars and the view to the new size.
- e
- The event data.
OnRightToLeftChanged
Mirrors the board when the reading direction changes.
- e
- The event data.
OnScheduleChanged
Raises ScheduleChanged.
- e
- The event data.
OnSelectedTaskChanged
Raises SelectedTaskChanged.
- e
- The event data.
OnTaskActivated
Raises TaskActivated.
- e
- The task that was activated.
Reschedule
Schedules the plan and lays the board out again now, and raises ScheduleChanged. Needed after changing a plain list or a column in place.
ScrollToTask
Scrolls the board until a task's card is in view. Does nothing for a task that has no card.
- task
- The task to show.
Events
CardMoved
Raised after a card has moved and its task has been changed.
CardMoving
Raised before a card moves, by a drag, a keyboard drop or MoveCard. Set Cancel to refuse the move; nothing will have changed.
ScheduleChanged
Raised after the plan has been scheduled again because something changed: a task, a link, a collection, a calendar setting, or a call to Reschedule.
SelectedTaskChanged
Raised when the selected card changes, by the reader or by SelectedTask.
TaskActivated
Raised when the reader double-clicks a card or presses Enter on the selected one.