本文整理汇总了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