Export (0) Print
Expand All

EntityCollection class

Collection of entity metadata for assignment, calendar, constraint, outline code, project, resource, and task entities.

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

Namespace:  Microsoft.Office.Project.Server.Library
Assembly:  Microsoft.Office.Project.Server.Library (in Microsoft.Office.Project.Server.Library.dll)

public sealed class EntityCollection : CollectionBase

Use EntityCollection to obtain the GUID of an entity type for use in PSI methods.

The following code fragment uses the resource entity GUID in order to get all of the resource custom fields with the ReadCustomFieldsByEntity method. WebSvcCustomFields is the arbitrary name of a reference to the CustomFields.asmx Web service.

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));
. . .

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft