リソースとカレンダー

リソースクラスは、 カレンダープロパティを公開します。これは、リソースのカレンダーを設定または取得するために使用されます。このプロパティは、 カレンダーオブジェクトを受け入れて返します。

リソースカレンダーの操作

Microsoftプロジェクトのリソースのカレンダーを定義するには:

  1. リソースシートで、目的のリソースをダブルクリックします。
  2. 作業時間の変更ボタンをクリックします。

Microsoft Projectの労働時間の変化

Microsoftプロジェクトの労働時間の変化

Aspose.Tasks を使用してリソースカレンダーを設定

次のコードでは、標準カレンダーとリソースを作成し、カレンダーをリソースに割り当てます。

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ResourceAndCalendars.class);
 4
 5Project project = new Project(dataDir + "input.mpp");
 6ResourceCollection alRes = project.getResources();
 7for (Resource res : alRes) {
 8    if (res.get(Rsc.NAME) != null) {
 9        // code to display res.Calendar properties
10    }
11}

**Getting Resource Calendar using Aspose.Tasks **

The code below shows how to set resource calendars by traversing a project’s resources.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ResourceAndCalendars.class);
 4
 5Project project = new Project();
 6Resource res = project.getResources().add("Resource1");
 7
 8// add standard calendar
 9Calendar cal = project.getCalendars().add("Resource1");
10res.set(Rsc.CALENDAR, cal);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.