Share via


ProfileSubtypeManager - Classe

Crée, supprime, récupère et gère les sous-types de profil pour un type de profil.

Hiérarchie d’héritage

System.Object
  Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager

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

Syntaxe

'Déclaration
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
Public Class ProfileSubtypeManager
'Utilisation
Dim instance As ProfileSubtypeManager
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
public class ProfileSubtypeManager

Remarques

L'exemple suivant montre comment utiliser le ProfileSubtypeManager pour créer un profil d'utilisateur et un profil d'organisation ProfileSubtype.

using Microsoft.Office.Server.UserProfiles;
using Microsoft.SharePoint;
 
namespace CreateSubtype
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("http://<servername>"))
            {
                SPServiceContext context = SPServiceContext.GetContext(site);
                ProfileSubtypeManager psm = ProfileSubtypeManager.Get(context);
 
                // create a user profile subtype
                psm.CreateSubtype("Consultant", "Consultant Subtype", ProfileType.User);
 
                // create an organization profile subtype
                psm.CreateSubtype("Vendor", "Vendor Subtype", ProfileType.Organization);
            }
        }
    }
}

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

ProfileSubtypeManager - Membres

Microsoft.Office.Server.UserProfiles - Espace de noms