Freigeben über


TransactionAttribute.Value-Eigenschaft

Ruft den TransactionOption-Wert für die Transaktion ab und deaktiviert dabei optional den Transaktionsdienst.

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

Syntax

'Declaration
Public ReadOnly Property Value As TransactionOption
'Usage
Dim instance As TransactionAttribute
Dim value As TransactionOption

value = instance.Value
public TransactionOption Value { get; }
public:
property TransactionOption Value {
    TransactionOption get ();
}
/** @property */
public TransactionOption get_Value ()
public function get Value () : TransactionOption

Eigenschaftenwert

Der angegebene Transaktionstyp, ein TransactionOption-Wert.

Beispiel

Im folgenden Codebeispiel wird der Wert der Value-Eigenschaft eines Transaction-Attributs abgerufen.

<Transaction(TransactionOption.RequiresNew)>  _
Public Class TransactionAttribute_Value
    Inherits ServicedComponent
    
    Public Sub ValueExample() 
        ' Get the TransactionAttribute applied to the class.
        Dim attribute As TransactionAttribute = CType(Attribute.GetCustomAttribute(Me.GetType(), GetType(TransactionAttribute), False), TransactionAttribute)
        
        ' Display the value of the attribute's Value property.
        MsgBox("TransactionAttribute.Value: " & attribute.Value)
    
    End Sub 'ValueExample
End Class 'TransactionAttribute_Value
[Transaction(TransactionOption.RequiresNew)]
public class TransactionAttribute_Value : ServicedComponent
{
    public void ValueExample()
    {
        // Get the TransactionAttribute applied to the class.
        TransactionAttribute attribute =
            (TransactionAttribute)Attribute.GetCustomAttribute(
            this.GetType(),
            typeof(TransactionAttribute),
            false);

        // Display the value of the attribute's Value property.
        Console.WriteLine("TransactionAttribute.Value: {0}",
            attribute.Value);
    }
}
/** @attribute Transaction(TransactionOption.RequiresNew)
 */
public class TransactionAttribute_Value extends ServicedComponent
{
    public void ValueExample()
    {
        // Get the TransactionAttribute applied to the class.
        TransactionAttribute attribute = (TransactionAttribute)(
            Attribute.GetCustomAttribute(this.GetType(),
            TransactionAttribute.class.ToType(), false));

        // Display the value of the attribute's Value property.
        Console.WriteLine("TransactionAttribute.Value: {0}",
            attribute.get_Value());
    } //ValueExample
} //TransactionAttribute_Value

.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

TransactionAttribute-Klasse
TransactionAttribute-Member
System.EnterpriseServices-Namespace