ApplicationQueuingAttribute Classe

Définition

Active la prise en charge de la mise en file d'attente pour l'assembly marqué et permet à l'application de lire des appels de méthode à partir de files d'attente Message Queuing. Cette classe ne peut pas être héritée.

public ref class ApplicationQueuingAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=true)]
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class ApplicationQueuingAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=true)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
type ApplicationQueuingAttribute = class
    inherit Attribute
Public NotInheritable Class ApplicationQueuingAttribute
Inherits Attribute
Héritage
ApplicationQueuingAttribute
Attributs

Exemples

L’exemple de code suivant illustre l’utilisation du ApplicationQueuingAttribute type .

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

// References:
// System.EnterpriseServices

[assembly: ApplicationQueuing]

public class ApplicationQueuingExample : 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(),
            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);

    }

    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(),
            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);

    }

    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(),
            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);

    }
}
Imports System.EnterpriseServices
Imports System.Reflection


' References:
' System.EnterpriseServices

<Assembly: ApplicationQueuing()> 

Public Class ApplicationQueuingExample
    Inherits ServicedComponent
    
    Public Sub 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.
        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)

    End Sub



    Public Sub 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.
        Dim attribute As ApplicationQueuingAttribute = CType(attribute.GetCustomAttribute(System.Reflection.Assembly.GetExecutingAssembly(), GetType(ApplicationQueuingAttribute), False), ApplicationQueuingAttribute)

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

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

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

    End Sub



    Public Sub 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.
        Dim attribute As ApplicationQueuingAttribute = CType(attribute.GetCustomAttribute(System.Reflection.Assembly.GetExecutingAssembly(), GetType(ApplicationQueuingAttribute), False), ApplicationQueuingAttribute)

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

        ' Set the MaxListenerThreads property value of the attribute.
        attribute.MaxListenerThreads = 1

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

End Class

Remarques

Pour obtenir la liste des valeurs de propriété initiales d’une instance de ApplicationQueuingAttribute, consultez le ApplicationQueuingAttribute constructeur.

Pour plus d’informations sur l’utilisation des attributs, consultez Attributs.

Constructeurs

ApplicationQueuingAttribute()

Initialise une nouvelle instance de la classe ApplicationQueuingAttribute, activant la prise en charge de la mise en file d'attente pour l'assembly et initialisant Enabled, QueueListenerEnabled et MaxListenerThreads.

Propriétés

Enabled

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

MaxListenerThreads

Obtient ou définit le nombre de threads utilisés pour récupérer des messages de la file d'attente et pour activer le composant correspondant.

QueueListenerEnabled

Obtient ou définit une valeur indiquant si l'application accepte les appels de composants en file d'attente qui proviennent de clients.

TypeId

Lors de l'implémentation dans une classe dérivée, obtient un identificateur unique pour l'objet Attribute.

(Hérité de Attribute)

Méthodes

Equals(Object)

Retourne une valeur qui indique si cette instance est égale à un objet spécifié.

(Hérité de Attribute)
GetHashCode()

Retourne le code de hachage de cette instance.

(Hérité de Attribute)
GetType()

Obtient le Type de l'instance actuelle.

(Hérité de Object)
IsDefaultAttribute()

En cas de substitution dans une classe dérivée, indique si la valeur de cette instance est la valeur par défaut pour la classe dérivée.

(Hérité de Attribute)
Match(Object)

En cas de substitution dans une classe dérivée, retourne une valeur indiquant si cette instance équivaut à un objet spécifié.

(Hérité de Attribute)
MemberwiseClone()

Crée une copie superficielle du Object actuel.

(Hérité de Object)
ToString()

Retourne une chaîne qui représente l'objet actuel.

(Hérité de Object)

Implémentations d’interfaces explicites

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mappe un jeu de noms avec un jeu correspondant d'identificateurs de dispatch.

(Hérité de Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Récupère les informations de type pour un objet, qui peuvent être utilisées pour obtenir les informations de type d'une interface.

(Hérité de Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Récupère le nombre d'interfaces d'informations de type fourni par un objet (0 ou 1).

(Hérité de Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fournit l'accès aux propriétés et aux méthodes exposées par un objet.

(Hérité de Attribute)

S’applique à