SynchronizationOption Enum
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Anger vilken typ av automatisk synkronisering som begärs av komponenten.
public enum class SynchronizationOption
[System.Serializable]
public enum SynchronizationOption
[<System.Serializable>]
type SynchronizationOption =
Public Enum SynchronizationOption
- Arv
- Attribut
Fält
| Name | Värde | Description |
|---|---|---|
| Disabled | 0 | COM+ ignorerar synkroniseringskraven för komponenten när kontexten för objektet fastställs. |
| NotSupported | 1 | Ett objekt med det här värdet deltar aldrig i synkroniseringen, oavsett status för anroparen. Den här inställningen är endast tillgänglig för komponenter som inte är transaktionella och som inte använder JIT-aktivering (just-in-time). |
| Supported | 2 | Ett objekt med det här värdet deltar i synkroniseringen, om det finns. |
| Required | 3 | Ser till att alla objekt som skapats från komponenten synkroniseras. |
| RequiresNew | 4 | Ett objekt med det här värdet måste delta i en ny synkronisering där COM+ hanterar kontexter och lägenheter för alla komponenter som ingår i anropet. |
Exempel
I följande kodexempel visas användningen av SynchronizationOption typen.
#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.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
' 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
' 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
' 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
' A new activity will always be created for an instance of this class.
<Synchronization(SynchronizationOption.RequiresNew)> _
Public Class SynchronizationAttribute_SynchronizationRequiresNew
Inherits ServicedComponent
End Class