Dies sollte Ihnen ermöglichen, das Timeout zu ändern und dann zu überprüfen, dass es geändert wurde.
public int Zeitlimit {get; einstellen; }
[Transaktion (Timeout = 30)] public class TransactionAttribute_Timeout: ServicedComponent { public void TimeoutExample() { // Holen Sie sich das Transaction auf die Klasse angewendet. TransactionAttribute-Attribut = (Transaktionsattribut) Attribute.GetCustomAttribute ( this.GetType(), typeof (Transaktionsattribut), false);
// Display the current value of the attribute's Timeout property.
Console.WriteLine("TransactionAttribute.Timeout: {0}",
attribute.Timeout);
// Set the Timeout property value of the attribute to sixty
// seconds.
attribute.Timeout = 60;
// Display the new value of the attribute's Timeout property.
Console.WriteLine("TransactionAttribute.Timeout: {0}",
attribute.Timeout);
}
}