CardMovingEventArgs
Provides data for the task board's TaskBoard.CardMoving event: a card about to move to
another column, lane or position, which a handler can inspect and refuse.
public class CardMovingEventArgs : CancelEventArgs
Inherits from / implements: CancelEventArgs
Remarks
The task has not changed yet. Set CancelEventArgs.Cancel to true to
refuse the move: the card goes back where it was and nothing is written. Otherwise the board sets
the task's ProjectTask.Status to ToStatus, sets the field the lanes are
split by to ToLane, and renumbers the ProjectTask.Rank of the cards in
the cell it lands in.
Examples
board.CardMoving += (sender, e) =>
{
// Only work that has been reviewed can be marked done.
if (e.ToStatus == "Done" && e.FromStatus != "Review")
{
e.Cancel = true;
statusText.Text = "\"" + e.Task.Name + "\" has to be reviewed first.";
}
};Members at a glance
| Constructors | |
|---|---|
CardMovingEventArgs | Creates the data for a proposed card move. |
| Properties | |
FromLane | Gets the lane the card is in now. |
FromStatus | Gets the status of the column the card is in now. |
Source | Gets how the move was made: TaskEditSource.Pointer,
TaskEditSource.Keyboard or TaskEditSource.Application. |
Task | Gets the task whose card would move. It has not changed yet. |
ToIndex | Gets the card's position in the cell (the column within the lane) it would go to. |
ToLane | Gets the lane the card would go to. |
ToStatus | Gets the status of the column the card would go to: the task's new
ProjectTask.Status. |
Constructors
CardMovingEventArgs
Creates the data for a proposed card move.
Parameters
task- The task whose card would move.
source- How the move was made.
fromStatus- The status of the column the card is in.
toStatus- The status of the column it would go to.
fromLane- The lane it is in; empty for the lane of tasks without a value.
toLane- The lane it would go to; empty for the lane of tasks without a value.
toIndex- Its position in the cell it would go to, from 0.
Properties
FromLane
Gets the lane the card is in now.
- Value
- An assignee, a category or a phase's task id, as the board's lanes are split; empty for the lane of tasks without a value, and for a board with no lanes.
FromStatus
Gets the status of the column the card is in now.
- Value
- A
BoardColumn.Status. A task whose own status has no column is shown in the first column, and this is that column's status.
Source
Gets how the move was made: TaskEditSource.Pointer,
TaskEditSource.Keyboard or TaskEditSource.Application.
Task
Gets the task whose card would move. It has not changed yet.
ToIndex
Gets the card's position in the cell (the column within the lane) it would go to.
- Value
- From 0, the top of the cell.
ToLane
Gets the lane the card would go to.
ToStatus
Gets the status of the column the card would go to: the task's new
ProjectTask.Status.