Freigeben über


SynchronizationOption-Enumeration

Gibt den Typ der von der Komponente angeforderten automatischen Synchronisierung an.

Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)

Syntax

'Declaration
<SerializableAttribute> _
Public Enumeration SynchronizationOption
'Usage
Dim instance As SynchronizationOption
[SerializableAttribute] 
public enum SynchronizationOption
[SerializableAttribute] 
public enum class SynchronizationOption
/** @attribute SerializableAttribute() */ 
public enum SynchronizationOption
SerializableAttribute 
public enum SynchronizationOption

Member

  Membername Beschreibung
Disabled COM+ ignoriert beim Bestimmen des Kontexts für das Objekt die Synchronisierungsanforderungen der Komponente. 
NotSupported Ein Objekt mit diesem Wert nimmt unabhängig vom Status seines Aufrufers nie an einer Synchronisierung teil. Diese Einstellung ist nur für nicht transaktionale Komponenten verfügbar, die keine JIT (Just-in-Time)-Aktivierung verwenden. 
Required Stellt sicher, dass alle aus der Komponente erstellten Objekte synchronisiert werden. 
RequiresNew Ein Objekt mit diesem Wert muss an einer neuen Synchronisierung teilnehmen, in der Kontexte und Apartments durch COM+ stellvertretend für alle am Aufruf beteiligten Komponenten verwaltet werden. 
Supported Ein Objekt mit diesem Wert nimmt an der Synchronisierung teil, sofern vorhanden. 

Beispiel

Im folgenden Codebeispiel wird die Verwendung des SynchronizationOption-Typs veranschaulicht.

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
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
{
}
#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
{
};
import System.*;
import System.EnterpriseServices.*;
import 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.
/** @attribute Synchronization(SynchronizationOption.Disabled)
 */
public class SynchronizationAttribute_SynchronizationDisabled 
    extends ServicedComponent
{
} //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.
/** @attribute Synchronization(SynchronizationOption.NotSupported)
 */
public class SynchronizationAttribute_SynchronizationNotSupported 
    extends ServicedComponent
{
} //SynchronizationAttribute_SynchronizationNotSupported

// An instance of this class will join its caller's activity if one exists.
/** @attribute Synchronization(SynchronizationOption.Supported)
 */
public class SynchronizationAttribute_SynchronizationSupported 
    extends ServicedComponent
{
} //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.
/** @attribute Synchronization(SynchronizationOption.Required)
 */
public class SynchronizationAttribute_SynchronizationRequired 
    extends ServicedComponent
{
} //SynchronizationAttribute_SynchronizationRequired

// A new activity will always be created for an instance of this class.
/** @attribute Synchronization(SynchronizationOption.RequiresNew)
 */
public class SynchronizationAttribute_SynchronizationRequiresNew 
    extends ServicedComponent
{
} //SynchronizationAttribute_SynchronizationRequiresNew

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

System.EnterpriseServices-Namespace