ApplicationQueuingAttribute.Enabled Eigenschaft

Definition

Ruft einen Wert ab, der angibt, ob die Warteschlangenunterstützung aktiviert ist, oder legt diesen fest.

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

Eigenschaftswert

true, wenn die Warteschlangenunterstützung aktiviert ist, andernfalls false. Der durch den Konstruktor festgelegte Standardwert ist true.

Beispiele

Im folgenden Codebeispiel wird der Wert der Eigenschaft eines ApplicationQueuing Attributs Enabled abgerufen und festgelegt.

// 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)

Hinweise

Anwendungen können standardmäßig keine Komponenten in der Warteschlange verwenden. Die Instanziierung ApplicationQueuingAttribute ermöglicht es einer Anwendung, Komponenten in Warteschlange zu verwenden. Die Anwendung kann jedoch nicht auf Nachrichten von Clients in die Warteschlange lauschen.

Gilt für: