자원 및 캘린더 작업
Contents
[
Hide
Show
]Resource 클래스는 자원의 캘린더를 설정하거나 얻는 데 사용되는 캘린더 속성을 노출시킵니다. 이 속성은 Aspose.Tasks .calendar 객체를 수락하고 반환합니다.
자원 캘린더 작업
Microsoft Project의 리소스에 대한 캘린더 정의 :
- 자원 시트에서 원하는 리소스를 두 번 클릭하십시오.
- 작업 시간 변경 버튼을 클릭하십시오.
Aspose.Tasks를 사용하여 리소스 캘린더 설정
다음 코드는 표준 캘린더 및 리소스를 생성 한 다음 캘린더를 리소스에 할당합니다.
1Project project = new Project();
2Resource res = project.Resources.Add("Resource1");
3
4// Add standard calendar and assign to resource
5Calendar cal = project.Calendars.Add("Resource1");
6res.Set(Rsc.Calendar, cal);
**Getting Resource Calendar using Aspose.Tasks **
The code below shows how to get resource calendars by traversing a project’s resources.
1Project project = new Project("New Project.mpp");
2
3// Display base calendar name for all resources
4foreach (Resource res in project.Resources)
5{
6 if (res.Get(Rsc.Name) != null)
7 {
8 Console.WriteLine(res.Get(Rsc.Calendar).BaseCalendar.Name);
9 }
10}