SynchronizationOption SynchronizationOption SynchronizationOption SynchronizationOption Enum

Definición

Especifica el tipo de sincronización automática solicitada por el componente.Specifies the type of automatic synchronization requested by the component.

public enum class SynchronizationOption
[System.Serializable]
public enum SynchronizationOption
type SynchronizationOption = 
Public Enum SynchronizationOption
Herencia
SynchronizationOptionSynchronizationOptionSynchronizationOptionSynchronizationOption
Atributos

Campos

Disabled Disabled Disabled Disabled 0

COM+ hace caso omiso de las solicitudes de sincronización del componente cuando determina el contexto para el objeto.COM+ ignores the synchronization requirements of the component when determining context for the object.

NotSupported NotSupported NotSupported NotSupported 1

Un objeto con este valor nunca participa en la sincronización, independientemente del estado de su llamador.An object with this value never participates in synchronization, regardless of the status of its caller. Esta opción sólo está disponible para componentes que no son transaccionales y que no utilizan activación JIT (Just-In-Time).This setting is only available for components that are non-transactional and do not use just-in-time (JIT) activation.

Required Required Required Required 3

Garantiza que todos los objetos creados desde el componente están sincronizados.Ensures that all objects created from the component are synchronized.

RequiresNew RequiresNew RequiresNew RequiresNew 4

Un objeto con este valor debe participar en una nueva sincronización en la que COM+ administra contextos y apartamentos en nombre de todos los componentes involucrados en la llamada.An object with this value must participate in a new synchronization where COM+ manages contexts and apartments on behalf of all components involved in the call.

Supported Supported Supported Supported 2

Un objeto con este valor participa en la sincronización, si existe.An object with this value participates in synchronization, if it exists.

Ejemplos

En el ejemplo de código siguiente se muestra el uso de la SynchronizationOption tipo.The following code example demonstrates the use of the SynchronizationOption type.

#using <System.EnterpriseServices.dll>

using namespace System;
using namespace System::EnterpriseServices;

// 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 ref class SynchronizationAttribute_SynchronizationDisabled :
    public 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 ref class SynchronizationAttribute_SynchronizationNotSupported :
    public ServicedComponent
{
};

// An instance of this class will join its caller's activity if one exists.
[Synchronization(SynchronizationOption::Supported)]
public ref class SynchronizationAttribute_SynchronizationSupported :
    public 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 ref class SynchronizationAttribute_SynchronizationRequired :
    public ServicedComponent
{
};

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

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
{
}

Imports System
Imports System.EnterpriseServices
Imports 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
    Inherits ServicedComponent
End Class 'SynchronizationAttribute_SynchronizationDisabled

' 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
    Inherits ServicedComponent
End Class 'SynchronizationAttribute_SynchronizationNotSupported

' An instance of this class will join its caller's activity if one exists.
<Synchronization(SynchronizationOption.Supported)>  _
Public Class SynchronizationAttribute_SynchronizationSupported
    Inherits ServicedComponent
End Class 'SynchronizationAttribute_SynchronizationSupported

' 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
    Inherits ServicedComponent
End Class 'SynchronizationAttribute_SynchronizationRequired

' A new activity will always be created for an instance of this class.
<Synchronization(SynchronizationOption.RequiresNew)>  _
Public Class SynchronizationAttribute_SynchronizationRequiresNew
    Inherits ServicedComponent
End Class 'SynchronizationAttribute_SynchronizationRequiresNew

Se aplica a