ApplicationQueuingAttribute Класс

Определение

Включает поддержку очередей для отмеченной сборки и позволяет приложению считывать вызовы методов из очередей сообщений. Этот класс не наследуется.

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
Наследование
ApplicationQueuingAttribute
Атрибуты

Примеры

В следующем примере кода показано использование ApplicationQueuingAttribute типа.

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

Комментарии

Список начальных значений свойств для экземпляра ApplicationQueuingAttributeсм. в конструкторе ApplicationQueuingAttribute .

Дополнительные сведения об использовании атрибутов см. в разделе "Атрибуты".

Конструкторы

ApplicationQueuingAttribute()

Инициализирует новый экземпляр класса ApplicationQueuingAttribute, включая поддержку очередей для сборки и инициализируя объекты Enabled, QueueListenerEnabled и MaxListenerThreads.

Свойства

Enabled

Возвращает или задает значение, показывающее, включена ли поддержка очередей.

MaxListenerThreads

Возвращает или задает число потоков, используемых для извлечения сообщений из очереди и включения соответствующего компонента.

QueueListenerEnabled

Возвращает или задает значение, показывающее, будет ли приложение принимать вызовы компонентов очереди от клиентов.

TypeId

В случае реализации в производном классе возвращает уникальный идентификатор для этого атрибута Attribute.

(Унаследовано от Attribute)

Методы

Equals(Object)

Возвращает значение, показывающее, равен ли экземпляр указанному объекту.

(Унаследовано от Attribute)
GetHashCode()

Возвращает хэш-код данного экземпляра.

(Унаследовано от Attribute)
GetType()

Возвращает объект Type для текущего экземпляра.

(Унаследовано от Object)
IsDefaultAttribute()

При переопределении в производном классе указывает, является ли значение этого экземпляра значением по умолчанию для производного класса.

(Унаследовано от Attribute)
Match(Object)

При переопределении в производном классе возвращает значение, указывающее, является ли этот экземпляр равным заданному объекту.

(Унаследовано от Attribute)
MemberwiseClone()

Создает неполную копию текущего объекта Object.

(Унаследовано от Object)
ToString()

Возвращает строку, представляющую текущий объект.

(Унаследовано от Object)

Явные реализации интерфейса

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

Сопоставляет набор имен соответствующему набору идентификаторов диспетчеризации.

(Унаследовано от Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Возвращает сведения о типе объекта, которые можно использовать для получения сведений о типе интерфейса.

(Унаследовано от Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Возвращает количество предоставляемых объектом интерфейсов для доступа к сведениям о типе (0 или 1).

(Унаследовано от Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Предоставляет доступ к открытым свойствам и методам объекта.

(Унаследовано от Attribute)

Применяется к