ApplicationQueuingAttribute.Enabled 屬性

定義

取得或設定值,指出是否啟用佇列支援。

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

屬性值

如果啟用佇列支援,則為 true,否則為 false。 建構函式設定的預設值為 true

範例

下列程式代碼範例會取得並設定 ApplicationQueuing 屬性的 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.
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)

備註

應用程式預設無法使用已排入佇列的元件。 具現化 ApplicationQueuingAttribute 可讓應用程式使用佇列元件;不過,它不會讓應用程式接聽來自用戶端的佇列訊息。

適用於