惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
G
Google Developers Blog
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
爱范儿
爱范儿
B
Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园_首页
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - 指南针

EpCloud开发日志 为服务创建安装程序 winform 通过WCF上传Dataset数据 opcrcw.da.dll 和.net 4.0 .net中线程同步的典型场景和问题(1) 如何取消后台线程的执行 python中使用汉字 Ext对基本类型的扩展 OWC ChartSpace控件的使用 OWC PivotTable的使用方法 Sql Server 生成数据透视表 wince5.0 key 修改IP地址后,原来的连接还有存在吗? Window下减少重绘的方法 .Net精简框加下子类化控件 Wince5.0中修改IP地址需不重启即可生效 Extjs combobox 使MSSql Server 视图可更新 javascript中的基本数据类型
Windows workflow中的IEventActivity接口
指南针 · 2008-05-06 · via 博客园 - 指南针

    实现IEventActivity接口的活动可以和ListenActivity活动配合使用。
    IEventActivity接口的原型如下

1IComparable QueueName
2{
3    get;
4}

5void Subscribe(ActivityExecutionContext parentContext, IActivityEventListener<QueueEventArgs> parentEventHandler);
6
7void Unsubscribe(ActivityExecutionContext parentContext, IActivityEventListener<QueueEventArgs> parentEventHandler);

    其中QueueName表示消息队列的名字。将IEventActivity活动放入在ListenActivity中时,ListenActivity活动启动时首先调用Subscribe方法,表示它开始订阅事件,通常应该在这儿做初始化工作。当ListenActivity活动从消息队列中收到一条消息时,它将调用Unsubscrible方法,表示已经收到消息,在此方法实现时应当从消息队列中读取消息,并做一些资源清理工作。
   在ListenActivity中的IEventActivity活动的执行过程为
      Subscribe();
      Unsubscribe();
      Execute();
   不在ListenActivity中的活动的执行过程为
     Execute();
     Waitting for queue event.