ApplicationQueuingAttribute Klasa
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Umożliwia obsługę kolejkowania dla oznaczonego zestawu i umożliwia aplikacji odczytywanie wywołań metod z kolejek kolejkowania komunikatów. Klasa ta nie może być dziedziczona.
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
- Dziedziczenie
- Atrybuty
Poniższy przykład kodu pokazuje użycie ApplicationQueuingAttribute typu.
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
Aby uzyskać listę początkowych wartości właściwości dla wystąpienia programu ApplicationQueuingAttribute, zobacz ApplicationQueuingAttribute konstruktor.
Aby uzyskać więcej informacji na temat używania atrybutów, zobacz Atrybuty.
Application |
Inicjuje ApplicationQueuingAttribute nowe wystąpienie klasy, włączając obsługę kolejkowania Enableddla zestawu i inicjowania , QueueListenerEnabledi MaxListenerThreads. |
Enabled |
Pobiera lub ustawia wartość wskazującą, czy obsługa kolejkowania jest włączona. |
Max |
Pobiera lub ustawia liczbę wątków używanych do wyodrębniania komunikatów z kolejki i aktywowania odpowiedniego składnika. |
Queue |
Pobiera lub ustawia wartość wskazującą, czy aplikacja będzie akceptować wywołania składników w kolejce od klientów. |
Type |
Po zaimplementowaniu w klasie pochodnej pobiera unikatowy identyfikator dla tego elementu Attribute. (Odziedziczone po Attribute) |
Equals(Object) |
Zwraca wartość wskazującą, czy to wystąpienie jest równe podanemu obiektowi. (Odziedziczone po Attribute) |
Get |
Zwraca wartość skrótu dla tego wystąpienia. (Odziedziczone po Attribute) |
Get |
Type Pobiera bieżące wystąpienie. (Odziedziczone po Object) |
Is |
W przypadku zastąpienia w klasie pochodnej wskazuje, czy wartość tego wystąpienia jest wartością domyślną klasy pochodnej. (Odziedziczone po Attribute) |
Match(Object) |
W przypadku zastąpienia w klasie pochodnej zwraca wartość wskazującą, czy to wystąpienie jest równe określonemu obiektowi. (Odziedziczone po Attribute) |
Memberwise |
Tworzy płytkią kopię bieżącego Objectelementu . (Odziedziczone po Object) |
To |
Zwraca ciąg reprezentujący bieżący obiekt. (Odziedziczone po Object) |
_Attribute. |
Zestaw nazw jest mapowany na odpowiedni zestaw identyfikatorów wysyłania. (Odziedziczone po Attribute) |
_Attribute. |
Pobiera informacje o typie obiektu, którego można użyć do pobrania informacji o typie interfejsu. (Odziedziczone po Attribute) |
_Attribute. |
Pobiera informację o liczbie typów interfejsów, jakie zawiera obiekt (0 lub 1). (Odziedziczone po Attribute) |
_Attribute. |
Umożliwia dostęp do właściwości i metod udostępnianych przez obiekt. (Odziedziczone po Attribute) |
Produkt | Wersje |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: