Table of Contents

Class ChartTask

Namespace
TwBlazor.Models
Assembly
TwBlazor.dll

A scheduled task, plotted by TwGanttChart.

public sealed record ChartTask : IEquatable<ChartTask>
Inheritance
ChartTask
Implements
Inherited Members

Remarks

A task that ends when it starts (or before) is a milestone, drawn as a diamond. A task that other tasks name as their ParentId is a summary: its dates and progress are rolled up from the tasks under it.

Constructors

ChartTask(string, DateTime, DateTime)

A scheduled task, plotted by TwGanttChart.

public ChartTask(string Label, DateTime Start, DateTime End)

Parameters

Label string

The task name shown on the axis, tooltips and table view.

Start DateTime

When the task starts.

End DateTime

When the task ends.

Remarks

A task that ends when it starts (or before) is a milestone, drawn as a diamond. A task that other tasks name as their ParentId is a summary: its dates and progress are rolled up from the tasks under it.

Properties

ColorIndex

Gets the zero-based slot of the theme's series colors the bar uses. Defaults to the first.

public int? ColorIndex { get; init; }

Property Value

int?

End

When the task ends.

public DateTime End { get; init; }

Property Value

DateTime

Id

Gets the identifier that dependencies and child tasks use to refer to this task. Defaults to Label, so it only needs setting when two tasks share a name.

public string? Id { get; init; }

Property Value

string

Key

Gets the identifier the chart uses for the task: Id, or Label when that is not set.

public string Key { get; }

Property Value

string

Label

The task name shown on the axis, tooltips and table view.

public string Label { get; init; }

Property Value

string

ParentId

Gets the identifier of the summary task this task sits under, or null for a top-level task.

public string? ParentId { get; init; }

Property Value

string

Progress

Gets how far along the task is, from 0 (not started) to 1 (done), or null to show no progress.

public double? Progress { get; init; }

Property Value

double?

Start

When the task starts.

public DateTime Start { get; init; }

Property Value

DateTime

Methods

Deconstruct(out string, out DateTime, out DateTime)

public void Deconstruct(out string Label, out DateTime Start, out DateTime End)

Parameters

Label string
Start DateTime
End DateTime

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(ChartTask?)

public bool Equals(ChartTask? other)

Parameters

other ChartTask

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ChartTask?, ChartTask?)

public static bool operator ==(ChartTask? left, ChartTask? right)

Parameters

left ChartTask
right ChartTask

Returns

bool

operator !=(ChartTask?, ChartTask?)

public static bool operator !=(ChartTask? left, ChartTask? right)

Parameters

left ChartTask
right ChartTask

Returns

bool