Freigeben über


ContextUtil.IsInTransaction-Eigenschaft

Ruft einen Wert ab, der angibt, ob der aktuelle Kontext transaktional ist.

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

Syntax

'Declaration
Public Shared ReadOnly Property IsInTransaction As Boolean
'Usage
Dim value As Boolean

value = ContextUtil.IsInTransaction
public static bool IsInTransaction { get; }
public:
static property bool IsInTransaction {
    bool get ();
}
/** @property */
public static boolean get_IsInTransaction ()
public static function get IsInTransaction () : boolean

Eigenschaftenwert

true, wenn der aktuelle Kontext transaktional ist, andernfalls false.

Ausnahmen

Ausnahmetyp Bedingung

COMException

Es ist kein COM+-Kontext verfügbar.

Beispiel

Im folgenden Codebeispiel wird der Wert einer IsInTransaction-Eigenschaft abgerufen.

<Transaction(TransactionOption.Required)>  _
Public Class ContextUtil_IsInTransaction
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Display whether the current COM+ context is enlisted in a
        ' transaction.
        MsgBox("Current context enlisted in transaction: " & ContextUtil.IsInTransaction)

    End Sub 'Example
End Class 'ContextUtil_IsInTransaction
[Transaction(TransactionOption.Required)]
public class ContextUtil_IsInTransaction : ServicedComponent
{
    public void Example()
    {
        // Display whether the current COM+ context is enlisted in a
        // transaction.
        Console.WriteLine("Current context enlisted in transaction: {0}",
            ContextUtil.IsInTransaction);
    }
}
[Transaction(TransactionOption::Required)]
public ref class ContextUtil_IsInTransaction: public ServicedComponent
{
public:
   void Example()
   {
      // Display whether the current COM+ context is enlisted in a
      // transaction.
      Console::WriteLine( "Current context enlisted in transaction: {0}", 
         ContextUtil::IsInTransaction );
   }
};
/** @attribute Transaction(TransactionOption.Required)
 */
public class ContextUtil_IsInTransaction extends ServicedComponent
{
    public void Example()
    {
        // Display whether the current COM+ context is enlisted in a
        // transaction.
        Console.WriteLine("Current context enlisted in transaction: {0}",
            System.Convert.ToString(ContextUtil.get_IsInTransaction()));
    } //Example
} //ContextUtil_IsInTransaction

.NET Framework-Sicherheit

  • Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .

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

ContextUtil-Klasse
ContextUtil-Member
System.EnterpriseServices-Namespace