共用方式為


PublishedProject.IncludeCustomFields 屬性

取得PublishedProject物件,其中包含自訂欄位。

命名空間:  Microsoft.ProjectServer.Client
組件:  Microsoft.ProjectServer.Client (在 Microsoft.ProjectServer.Client.dll 中)

語法

'宣告
<RemoteAttribute> _
Public ReadOnly Property IncludeCustomFields As PublishedProject
    Get
'用途
Dim instance As PublishedProject
Dim value As PublishedProject

value = instance.IncludeCustomFields
[RemoteAttribute]
public PublishedProject IncludeCustomFields { get; }

屬性值

類型:Microsoft.ProjectServer.Client.PublishedProject
已發佈的專案。

備註

專案具有許多自訂欄位,效能可能很緩慢擷取及儲存專案時。當您使用PublishedProject.CheckOut方法來取出專案中,根據預設, DraftProject物件不包含在自訂欄位。使用IncludeCustomFields屬性,來取出的專案會包含自訂欄位的資訊。

範例

下列CheckoutProject方法取出的專案,包括自訂欄位。

private static DraftProject CheckoutProject(ProjectContext projContext, string projName)
{
    DraftProject projCheckedOut = null;

    var projCollection = projContext.LoadQuery(
        projContext.Projects
            .Where(p => p.Name == projName));

    projContext.ExecuteQuery();

    if (projCollection.Count() > 0)
    {
        PublishedProject proj2Edit = projCollection.First().IncludeCustomFields;

        projCheckedOut = proj2Edit.CheckOut().IncludeCustomFields;
    }
    return projCheckedOut;
}

另一個程式碼範例,請參閱 < IncludeCustomFields。

請參閱

參照

PublishedProject 類別

PublishedProject 成員

Microsoft.ProjectServer.Client 命名空間

PublishedProject.CheckOut

DraftProject.IncludeCustomFields