Cela devrait vous permettre de changer le délai d'attente, puis de vérifier qu'il a été modifié.
public int Timeout {get; ensemble; }
[Transaction (Délai d'attente = 30)] public class TransactionAttribute_Timeout: ServicedComponent {public void TimeoutExample() { // Obtenez le TransactionAttribute appliqué à la classe. Attribut TransactionAttribute = (TransactionAttribute) Attribute.GetCustomAttribute ( this.GetType(), typeof (TransactionAttribute), 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);
}
}