Tsk.Id
Contents
[
Hide
]Tsk.Id field
The position identifier of a task within the list of tasks.
public static readonly Key<int, TaskKey> Id;
Examples
Shows how to read/write task properties.
var project = new Project();
// Add task and set task properties
var task = project.RootTask.Children.Add();
task.Set(Tsk.Name, "Task1");
task.Set(Tsk.Start, new DateTime(2020, 3, 31, 8, 0, 0));
task.Set(Tsk.Finish, new DateTime(2020, 3, 31, 17, 0, 0));
var collector = new ChildTasksCollector();
TaskUtils.Apply(project.RootTask, collector, 0);
// Parse through all the collected tasks
foreach (var tsk in collector.Tasks)
{
Console.WriteLine("Task Id: {0}", tsk.Get(Tsk.Id));
Console.WriteLine("Task Uid: {0}", tsk.Get(Tsk.Uid));
Console.WriteLine("Task Name: {0}", tsk.Get(Tsk.Name));
Console.WriteLine("Task Start: {0}", tsk.Get(Tsk.Start));
Console.WriteLine("Task Finish: {0}", tsk.Get(Tsk.Finish));
}
See Also
- struct Key<T,K>
- enum TaskKey
- class Tsk
- namespace Aspose.Tasks
- assembly Aspose.Tasks