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

推荐订阅源

L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
Y
Y Combinator Blog
博客园 - 聂微东
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
MyScale Blog
MyScale Blog
Cloudbric
Cloudbric
T
Threatpost
Scott Helme
Scott Helme
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Engineering at Meta
Engineering at Meta
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
V2EX - 技术
V2EX - 技术
罗磊的独立博客
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
S
Secure Thoughts
C
Cyber Attacks, Cyber Crime and Cyber Security
D
Docker
V
V2EX
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
O
OpenAI News
V
Vulnerabilities – Threatpost
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG

博客园 - ◎寶☆呗

Sharepoint 自定义字段(栏) 动态获取数据 Sharepoint 工具使用总结 Sharepoint 内存泄漏 检测工具+-- Extjs 中的tbar中的事件 winform Tab键循序 小发现 instsrv.exe——来自Windows 2000 Resource Kits的一个小工具 [转载]MOSS 2007 SP1 stsadm 194 条指令 (用命令行部署infopath Form )Deploy administrator-approved form templates using command line sharepoint计时器(定时发邮件) Infopath开发经验(xml数据) Creating a Custom SharePoint 2007 List Definition 通过Sharepoint扩展的Webserives来获取某一权限是是否存在 Create a New SharePoint Permission Level and Bind it to an Existing SharePoint Group 执行带返回参数的存储过程 Sorry.....Sorry..... 操作Infopath中的XMl C#编程规范<二> C#代码规范. 工作需要养成的习惯(个人经验)
基本活动:CodeActivity
◎寶☆呗 · 2008-02-03 · via 博客园 - ◎寶☆呗

CodeActivity

Code活动只有一个值得注意的功能-ExecuteCode事件.如果我们没有指定这个事件的处理程序, Code活动就不会通过验证.在工作流设计器中,我们可以双击Code活动,Visual Studio会自动创建并分配事件处理程序-我们所需要做的只是编写其中的代码实现而已.下面的代码演示了利用ExecuteCode事件在控制台中输出一条消息:
private void codeActivity1_ExecuteCode(object sender, EventArgs e)
{
Console.WriteLine(
"Hello, world!");
}

这是指定了ExecuteCode事件的CodeActivity
虽然在工作流中执行自定义代码非常有用,但是实际上Code活动应该尽量少使用.我们应该将这些代码封装到自定义活动中.自定义活动可以拥有属性,而且可以重复使用.

而且,许多活动在执行时都会触发事件.有时候,我们完全可以不使用Code活动,仅仅通过在这些事件中编写代码就可以达到预期的效果.