本文整理匯總了VB.NET中System.EnterpriseServices.ApplicationQueuingAttribute類的典型用法代碼示例。如果您正苦於以下問題:VB.NET ApplicationQueuingAttribute類的具體用法?VB.NET ApplicationQueuingAttribute怎麽用?VB.NET ApplicationQueuingAttribute使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ApplicationQueuingAttribute類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: ApplicationQueuingExample
' 導入命名空間
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