Exportar (0) Imprimir
Expandir Tudo
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original

Classe ApplicationQueuingAttribute

Permite o suporte a enfileirar de mensagens para o assembly marcado e permite que o aplicativo para ler chamadas de método de filas de enfileirar de mensagens. Esta classe não pode ser herdada.

Namespace:  System.EnterpriseServices
Assembly:  System.EnterpriseServices (em System.EnterpriseServices.dll)

[AttributeUsageAttribute(AttributeTargets.Assembly, Inherited = true)]
[ComVisibleAttribute(false)]
public sealed class ApplicationQueuingAttribute : Attribute

Para obter uma lista de valores de propriedade inicial de uma instância de ApplicationQueuingAttribute, consulte o ApplicationQueuingAttribute construtor.

Para obter mais informações sobre como usar atributos, consulte Estendendo metadados usando atributos.

O exemplo de código a seguir demonstra o uso do ApplicationQueuingAttribute Digite.

using System;
using System.EnterpriseServices;
using System.Reflection;

// References:// System.EnterpriseServices

[assembly: ApplicationQueuing]

publicclass ApplicationQueuingExample : ServicedComponent
{
    publicvoid ApplicationQueuingAttribute_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);

    }

    publicvoid ApplicationQueuingAttribute_QueueListenerEnabled()
    {
        // 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 QueueListenerEnabled// property.
        Console.WriteLine(
            "ApplicationQueuingAttribute.QueueListenerEnabled: {0}",
            attribute.Enabled);

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

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

    }

    publicvoid ApplicationQueuingAttribute_MaxListenerThreads()
    {
        // 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 MaxListenerThreads// property.
        Console.WriteLine(
            "ApplicationQueuingAttribute.MaxListenerThreads: {0}",
            attribute.MaxListenerThreads);

        // Set the MaxListenerThreads property value of the attribute.
        attribute.MaxListenerThreads = 1;

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

    }
}



import System.*;
import System.EnterpriseServices.*;
import System.Reflection.*;

// References:
// System.EnterpriseServices
/** @assembly ApplicationQueuing()
 */

public class ApplicationQueuingExample extends ServicedComponent
{
    public void ApplicationQueuingAttribute_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(), ApplicationQueuingAttribute.class.ToType(),
            false));

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

        // Set the Enabled property value of the attribute.
        attribute.set_Enabled(false);

        // Display the new value of the attribute's Enabled property.
        Console.WriteLine("ApplicationQueuingAttribute.Enabled: {0}",
            System.Convert.ToString(attribute.get_Enabled()));
    } //ApplicationQueuingAttribute_Enabled

    public void ApplicationQueuingAttribute_QueueListenerEnabled()
    {
        // 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(), ApplicationQueuingAttribute.class.ToType(),
            false));
        // Display the current value of the attribute's QueueListenerEnabled
        // property.
        Console.WriteLine(
            "ApplicationQueuingAttribute.QueueListenerEnabled: {0}",
            System.Convert.ToString(attribute.get_Enabled()));

        // Set the QueueListenerEnabled property value of the attribute.
        attribute.set_QueueListenerEnabled(false);

        // Display the new value of the attribute's QueueListenerEnabled
        // property.
        Console.WriteLine(
            "ApplicationQueuingAttribute.QueueListenerEnabled: {0}",
            System.Convert.ToString(attribute.get_QueueListenerEnabled()));
    } //ApplicationQueuingAttribute_QueueListenerEnabled

    public void ApplicationQueuingAttribute_MaxListenerThreads()
    {
        // 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(), ApplicationQueuingAttribute.class.ToType(),
            false));

        // Display the current value of the attribute's MaxListenerThreads
        // property.
        Console.WriteLine("ApplicationQueuingAttribute.MaxListenerThreads: {0}",
            System.Convert.ToString(attribute.get_MaxListenerThreads()));

        // Set the MaxListenerThreads property value of the attribute.
        attribute.set_MaxListenerThreads(1);

        // Display the new value of the attribute's MaxListenerThreads
        // property.
        Console.WriteLine("ApplicationQueuingAttribute.MaxListenerThreads: {0}",
            System.Convert.ToString(attribute.get_MaxListenerThreads()));
    } //ApplicationQueuingAttribute_MaxListenerThreads
} //ApplicationQueuingExample


System.Object
  System.Attribute
    System.EnterpriseServices.ApplicationQueuingAttribute

Quaisquer membros static (Shared no Visual Basic) públicos deste tipo são thread-safe. Não há garantia de que qualquer membro de instância seja thread-safe.

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.

.NET Framework

Compatível com: 3.5, 3.0, 2.0, 1.1, 1.0

Contribuições da comunidade

ADICIONAR
Mostrar:
© 2014 Microsoft