Creating Resources in VSTO and Aspose.Tasks
Contents
[
Hide
Show
]Code Examples
VSTO
Below is code sample to create resource in project.
1string filename = @"E:\Aspose\Aspose Vs VSTO\Aspose.Tasks VS VSTO Projects\Sample Files\MyProject.mpp";
2object missingValue = System.Reflection.Missing.Value;
3Application.FileOpenEx(filename,
4 missingValue, missingValue, missingValue, missingValue,
5 missingValue, missingValue, missingValue, missingValue,
6 missingValue, missingValue, PjPoolOpen.pjPoolReadOnly,
7 missingValue, missingValue, missingValue, missingValue,
8 missingValue);
9Project project = Application.ActiveProject;
10project.Resources.Add("Material");
11project.Resources.Add("Work");
Aspose.Tasks
The Resource class allows to add a new resource to the project.
1Project project = new Project("MyProject.mpp");
2project.Resources.Add(new Resource("Material"));
3project.Resources.Add(new Resource("Cost"));