ApplicationQueuingAttribute.Enabled Propriedade

Definição

Obtém ou define um valor que indica se o suporte ao enfileiramento está habilitado.

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

Valor da propriedade

true se o suporte à fila estiver habilitado; caso contrário, false. O valor padrão definido pelo construtor é true.

Exemplos

O exemplo de código a seguir obtém e define o valor da propriedade de Enabled um ApplicationQueuing atributo.

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

Comentários

Os aplicativos não podem usar componentes enfileirados por padrão. A instanciação ApplicationQueuingAttribute permite que um aplicativo use componentes enfileirados; no entanto, ele não permite que o aplicativo ouça mensagens enfileiradas de clientes.

Aplica-se a