ApplicationQueuingAttribute.Enabled Propriété

Définition

Obtient ou définit une valeur indiquant si la prise en charge de la mise en file d'attente est activée.

public:
 property bool Enabled { bool get(); void set(bool value); };
public bool Enabled { get; set; }
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

Valeur de propriété

true si la prise en charge de la mise en file d'attente est activée ; sinon false. La valeur par défaut définie par le constructeur est true.

Exemples

L’exemple de code suivant obtient et définit la valeur de la propriété d’un ApplicationQueuingEnabled attribut.

// This example code requires that an ApplicationQueuing attribute be
// applied to the assembly, as shown below:
// [assembly: ApplicationQueuing]

// Get the ApplicationQueuingAttribute applied to the assembly.
ApplicationQueuingAttribute attribute =
    (ApplicationQueuingAttribute)Attribute.GetCustomAttribute(
    System.Reflection.Assembly.GetExecutingAssembly(),
    typeof(ApplicationQueuingAttribute),
    false);

// Display the current value of the attribute's Enabled property.
Console.WriteLine("ApplicationQueuingAttribute.Enabled: {0}",
    attribute.Enabled);

// Set the Enabled property value of the attribute.
attribute.Enabled = false;

// Display the new value of the attribute's Enabled property.
Console.WriteLine("ApplicationQueuingAttribute.Enabled: {0}",
    attribute.Enabled);
' This example code requires that an ApplicationQueuing attribute be
' applied to the assembly, as shown below:
' [assembly: ApplicationQueuing]
' Get the ApplicationQueuingAttribute applied to the assembly.
Dim attribute As ApplicationQueuingAttribute = CType(Attribute.GetCustomAttribute(System.Reflection.Assembly.GetExecutingAssembly(), GetType(ApplicationQueuingAttribute), False), ApplicationQueuingAttribute)

' Display the current value of the attribute's Enabled property.
MsgBox("ApplicationQueuingAttribute.Enabled: " & attribute.Enabled)

' Set the Enabled property value of the attribute.
attribute.Enabled = False

' Display the new value of the attribute's Enabled property.
MsgBox("ApplicationQueuingAttribute.Enabled: " & attribute.Enabled)

Remarques

Les applications ne peuvent pas utiliser les composants mis en file d’attente par défaut. L’instanciation ApplicationQueuingAttribute permet à une application d’utiliser des composants mis en file d’attente ; toutefois, elle ne permet pas à l’application d’écouter les messages mis en file d’attente des clients.

S’applique à