本文整理汇总了C#中System.EnterpriseServices.InterfaceQueuingAttribute类的典型用法代码示例。如果您正苦于以下问题:C# InterfaceQueuingAttribute类的具体用法?C# InterfaceQueuingAttribute怎么用?C# InterfaceQueuingAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InterfaceQueuingAttribute类属于System.EnterpriseServices命名空间,在下文中一共展示了InterfaceQueuingAttribute类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueuedTask
public interface IQueuedComponent
{
void QueuedTask();
}
// Mark IQueuedComponent interface as queued
[InterfaceQueuing(true, Interface="IQueuedComponent")]
// Create the queued component class by inheriting the
// System.EnterpriseServices.ServicedComponent class and an
// interface that is marked as queued with the InterfaceQueuing attribute
public class QueuedComponent : ServicedComponent, IQueuedComponent
{
public void QueuedTask()
{
// Perform queued task here
}
}
示例2: ApplicationQueuing
// Mark the COM+ application as queued at compile time by using the
// ApplicationQueuing attribute. Enable the COM+ listener by
// setting the QueueListenerEnabled to true
[assembly: ApplicationQueuing(Enabled=true, QueueListenerEnabled=true)]
示例3:
// Use BindToMoniker to run the queued moniker, to get an instance of the recorder
IQueuedComponent qc =
(IQueuedComponent)System.Runtime.InteropServices.Marshal.BindToMoniker("queue:/new:QueuedComponent");
// Call the method that will be recorded
qc.QueuedTask();
// Force the release of the recorder object, to send the message to the queue
System.Runtime.InteropServices.Marshal.ReleaseComObject(qc);