共用方式為


EntityCollection 類別

工作分派、 行事曆、 條件約束、 大綱代碼、 專案、 資源及工作實體的實體中繼資料的集合。

繼承階層架構

System.Object
  System.Collections.CollectionBase
    Microsoft.Office.Project.Server.Library.EntityCollection

命名空間:  Microsoft.Office.Project.Server.Library
組件:  Microsoft.Office.Project.Server.Library (在 Microsoft.Office.Project.Server.Library.dll 中)

語法

'宣告
Public NotInheritable Class EntityCollection _
    Inherits CollectionBase
'用途
Dim instance As EntityCollection
public sealed class EntityCollection : CollectionBase

備註

使用EntityCollection取得 PSI 方法使用的實體類型的 GUID。

範例

下列程式碼片段使用資源實體的 GUID,以取得所有資源自訂欄位與ReadCustomFieldsByEntity方法。WebSvcCustomFields是參照的任意名稱 CustomFields.asmx Web 服務。

using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
public static WebSvcCustomFields.CustomFields customFields =
    new WebSvcCustomFields.CustomFields();
. . .
string resourceEntity = PSLibrary.EntityCollection.Entities.ResourceEntity.UniqueId;

WebSvcCustomFields.CustomFieldDataSet cfDs = customFields.ReadCustomFieldsByEntity(
    new Guid(resourceEntity));
. . .

執行緒安全

這類型的任何公用 static (共用 於 Visual Basic 中) 成員是安全執行緒。不保證任何執行個體成員都是安全執行緒。

請參閱

參照

EntityCollection 成員

Microsoft.Office.Project.Server.Library 命名空間