프로젝트에서 Outline Codes 작업하기

Microsoft Project의 Outline codes는 기존의 프로젝트 구조와 달리 WBS codes 또는 outline numbers. 이러한 코드들은 특히 작업이나 리소스를 조직 또는 기업 표준에 따라 분류해야 할 때 유용합니다. Aspose.Tasks for .NET를 사용하면 outline codes와 해당 속성들을 검색, 분석 및 관리할 수 있습니다. 예: Alias, AllLevelsRequired, Enterprise, EnterpriseOutlineCodeAlias, FieldId, FieldName, PhoneticAlias, Guid, Masks, 그리고 Values.

Outline Codes 읽기

Project 클래스는 OutlineCodes 컬렉션을 제공하며, 이 컬렉션은 OutlineCodeDefinition 객체를 포함합니다.
이러한 정의들은 각 outline code에 대한 자세한 정보를 제공합니다.

다음 예제는 프로젝트에서 outline code 정보를 읽는 방법을 보여줍니다:

 1Project project = new Project("New Project.mpp");
 2
 3foreach (OutlineCodeDefinition ocd in project.OutlineCodes)
 4{
 5    Console.WriteLine("Alias = " + ocd.Alias);
 6    if (ocd.AllLevelsRequired)
 7        Console.WriteLine("It contains property: must have all levels");
 8    else
 9        Console.WriteLine("It does not contain property: must have all levels");
10    if (ocd.Enterprise)
11        Console.WriteLine("It is an enterprise custom outline code.");
12    else
13        Console.WriteLine("It is not an enterprise custom outline code.");
14
15    Console.WriteLine("Reference to another custom field for which this outline code definition is an alias is = " + ocd.EnterpriseOutlineCodeAlias);
16    Console.WriteLine("Field Id = " + ocd.FieldId);
17    Console.WriteLine("Field Name = " + ocd.FieldName);
18    Console.WriteLine("Phonetic Alias = " + ocd.PhoneticAlias);
19    Console.WriteLine("Guid = " + ocd.Guid);
20
21    // Display outline code masks
22    foreach (OutlineMask outlineMask in ocd.Masks)
23    {
24        Console.WriteLine("Level of a mask = " + outlineMask.Level);
25        Console.WriteLine("Mask = " + outlineMask.ToString());
26    }
27
28    // Display out line code values
29    foreach (OutlineValue outlineMask1 in ocd.Values)
30    {
31        Console.WriteLine("Description of outline value = " + outlineMask1.Description);
32        Console.WriteLine("Value Id = " + outlineMask1.ValueId);
33        Console.WriteLine("Value = " + outlineMask1.Value);
34        Console.WriteLine("Type = " + outlineMask1.Type);
35    }
36}

Outline Code Id의 고유성 확인

outline codes를 사용할 때, Aspose.Tasks for .NET 는 자동으로 Outline Code IDs의 고유성을 검사합니다. 중복 ID가 발견되면 데이터 무결성을 유지하기 위해 고유한 값으로 대체됩니다.

 1Project project = new Project("New Project.mpp");
 2
 3OutlineCodeDefinition textOutline = new OutlineCodeDefinition();
 4textOutline.FieldId = ExtendedAttributeTask.OutlineCode7.ToString("D");
 5textOutline.Alias = "My Outline Code";
 6
 7project.OutlineCodes.Add(textOutline);
 8
 9OutlineMask mask = new OutlineMask();
10mask.Type = MaskType.Characters;
11textOutline.Masks.Add(mask);
12
13OutlineValue textValue = new OutlineValue();
14textValue.Value = "Text value 1";
15textValue.ValueId = 1;
16textValue.Type = OutlineValueType.Text;
17textValue.Description = "Text value descr 1";
18textOutline.Values.Add(textValue);
19
20project.Save("MultipleOutlineValues.mpp", SaveFileFormat.MPP);

Outline codes는 사용자 지정 분류 및 구조 를 Microsoft Project 데이터에 추가할 수 있는 강력한 방법을 제공합니다.
Aspose.Tasks for .NET을 사용하면 이러한 코드를 프로그래밍 방식으로 액세스하고 관리하여 일관성을 보장하고 중복 식별자와 같은 오류를 제거할 수 있습니다.
이를 통해 기업 전체의 표준을 적용하고 프로젝트 보고 및 분석을 개선하기가 더 쉬워집니다.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.