Aspose.Tasks.Examples.CSharp.WorkingWithFormulas.CalculateTextFunctions.CreateTestProjectWithCustomField C# (CSharp) Method

CreateTestProjectWithCustomField() public static method

public static CreateTestProjectWithCustomField ( ) : Project
return Project
        public static Project CreateTestProjectWithCustomField()
        {
            Project project = new Project();
            ExtendedAttributeDefinition attr = new ExtendedAttributeDefinition();
            attr.FieldId = ExtendedAttributeTask.Text1.ToString("D");
            attr.Alias = "Custom Field";
            project.ExtendedAttributes.Add(attr);

            Task task = project.RootTask.Children.Add("Task");

            ExtendedAttribute a = attr.CreateExtendedAttribute();
            task.ExtendedAttributes.Add(a);
            return project;
        }   
    }