ApplicationQueuingAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
針對標記的組件啟用佇列支援,並且讓應用程式能夠從訊息佇列的佇列讀取方法呼叫。 此類別無法獲得繼承。
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 。
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) |
將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。 (繼承來源 Attribute) |
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
擷取物件的類型資訊,可以用來取得介面的類型資訊。 (繼承來源 Attribute) |
_Attribute.GetTypeInfoCount(UInt32) |
擷取物件提供的類型資訊介面數目 (0 或 1)。 (繼承來源 Attribute) |
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
提供物件所公開的屬性和方法的存取權。 (繼承來源 Attribute) |