Share via


EntityCollection - Classe

Collection de métadonnées de l'entité pour l'affectation, calendrier, contrainte, code hiérarchique, projets, ressources et entités de tâche.

Hiérarchie d’héritage

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

Espace de noms :  Microsoft.Office.Project.Server.Library
Assembly :  Microsoft.Office.Project.Server.Library (dans Microsoft.Office.Project.Server.Library.dll)

Syntaxe

'Déclaration
Public NotInheritable Class EntityCollection _
    Inherits CollectionBase
'Utilisation
Dim instance As EntityCollection
public sealed class EntityCollection : CollectionBase

Remarques

Utilisez EntityCollection pour obtenir le GUID d'un type d'entité pour une utilisation dans les méthodes PSI.

Exemples

Le fragment de code suivant utilise l'entité de ressource GUID afin d'obtenir tous les champs personnalisés de ressource avec la méthode ReadCustomFieldsByEntity . WebSvcCustomFields est le nom arbitraire d'une référence au service Web de CustomFields.asmx.

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

Cohérence de thread

Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.

Voir aussi

Référence

EntityCollection - Membres

Microsoft.Office.Project.Server.Library - Espace de noms