작업 및 캘린더

Microsoft Project에서 일정을 특정 작업과 연결할 수 있습니다. ASPOSE.TASK는이 기능을 지원합니다.

달력이있는 작업

TSK 클래스는 작업과 관련된 캘린더를 설정하거나 얻는 데 사용되는 캘린더 필드를 노출시킵니다. 이 속성은 Aspose.Tasks .calendar 객체를 수락하거나 반환합니다.

Microsoft Project에서 작업을위한 캘린더를 작성하려면 :

  1. Microsoft Project에서 프로젝트를 시작하십시오.

  2. To assign the calendar to a task, double-click the task in the Task Entry form.

Setting Task Calendar

Create a standard calendar and create a task. Assign the Calendar to the task.

1Project project = new Project();
2
3// Add task
4Task task = project.RootTask.Children.Add("Task1");
5
6// Create calendar and assign to task
7Calendar cal = project.Calendars.Add("TaskCal1");
8task.Set(Tsk.Calendar, cal);

Getting Task Calendar

Get task calendar by traversing the tasks in a project.

 1Project project = new Project("New Project.mpp");
 2
 3// Declare ChildTasksCollector class object
 4ChildTasksCollector collector = new ChildTasksCollector();
 5
 6// Use TaskUtils to get all children tasks in RootTask
 7TaskUtils.Apply(project.RootTask, collector, 0);
 8
 9// Parse all the recursive children
10foreach (Task task in collector.Tasks)
11{
12    Calendar cal = task.Get(Tsk.Calendar);
13    Console.WriteLine("Task calendar name: {0}", cal == null ? "None" : cal.Name);
14}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.