本文整理汇总了C#中System.EnterpriseServices.ApplicationQueuingAttribute类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationQueuingAttribute类的具体用法?C# ApplicationQueuingAttribute怎么用?C# ApplicationQueuingAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationQueuingAttribute类属于System.EnterpriseServices命名空间,在下文中一共展示了ApplicationQueuingAttribute类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ApplicationQueuingAttribute_Enabled
//引入命名空间
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);
}
}
开发者ID:.NET开发者,项目名称:System.EnterpriseServices,代码行数:98,代码来源:ApplicationQueuingAttribute
注:本文中的System.EnterpriseServices.ApplicationQueuingAttribute类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论