Lire en anglais

Partager via


SynchronizationOption Énumération

Définition

Spécifie le type de synchronisation automatique demandé par le composant.

C#
[System.Serializable]
public enum SynchronizationOption
Héritage
SynchronizationOption
Attributs

Champs

Nom Valeur Description
Disabled 0

COM+ ignore les exigences de synchronisation du composant lors de la détermination du contexte pour l’objet.

NotSupported 1

Un objet avec cette valeur ne participe jamais à la synchronisation, et ce quel que soit l’état de son appelant. Ce paramètre est uniquement disponible pour les composants qui ne sont pas transactionnels et qui n’utilisent pas l’activation juste-à-temps (JIT).

Required 3

Assure que tous les objets créés à partir du composant sont synchronisés.

RequiresNew 4

Un objet avec cette valeur doit participer à une nouvelle synchronisation où COM+ gère les contextes et les cloisonnements de la part de tous les composants impliqués dans l’appel.

Supported 2

Un objet avec cette valeur participe à la synchronisation, le cas échéant.

Exemples

L’exemple de code suivant illustre l’utilisation du SynchronizationOption type .

C#
using System;
using System.EnterpriseServices;
using System.Reflection;

// References:
// System.EnterpriseServices

// An instance of this class will not join an activity, but can share its
// caller's context even if its caller is configured as NotSupported,
// Supported, Required, or RequiresNew.
[Synchronization(SynchronizationOption.Disabled)]
public class SynchronizationAttribute_SynchronizationDisabled :
    ServicedComponent
{
}

// An instance of this class will not join an activity, and will share its
// caller's context only if its caller is also configured as NotSupported.
[Synchronization(SynchronizationOption.NotSupported)]
public class SynchronizationAttribute_SynchronizationNotSupported :
    ServicedComponent
{
}

// An instance of this class will join its caller's activity if one exists.
[Synchronization(SynchronizationOption.Supported)]
public class SynchronizationAttribute_SynchronizationSupported :
    ServicedComponent
{
}

// An instance of this class will join its caller's activity if one exists.
// If not, a new activity will be created for it.
[Synchronization(SynchronizationOption.Required)]
public class SynchronizationAttribute_SynchronizationRequired :
    ServicedComponent
{
}

// A new activity will always be created for an instance of this class.
[Synchronization(SynchronizationOption.RequiresNew)]
public class SynchronizationAttribute_SynchronizationRequiresNew :
    ServicedComponent
{
}

S’applique à

Produit Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1