学WF系列(七)——改善登录程序(上)
2010-10-01 08:25:43 来源:WEB开发网Workflow1.cs:
public sealed partial class Workflow1 : SequentialWorkflowActivity
{
public Workflow1()
{
InitializeComponent();
}
private void handleExternalEventActivity1_Invoked(object sender, ExternalDataEventArgs e)
{
MessageBox.Show("Success");
}
}
Winform1.cs:
public partial class Form1 : Form,IEvent
{
private WorkflowRuntime runtime;
private ExternalDataExchangeService service;
private WorkflowInstance instance;
public Form1()
{
InitializeComponent();
runtime = new WorkflowRuntime();
service = new ExternalDataExchangeService();
runtime.AddService(service);
service.AddService(this);
runtime.StartRuntime();
}
private void button1_Click(object sender, EventArgs e)
{
instance = runtime.CreateWorkflow(typeof(WorkflowConsoleApplication7.Workflow1));
instance.Start();
ExternalDataEventArgs args = new ExternalDataEventArgs(instance.InstanceId);
MyEvent1(null, args);
}
#region IEvent 成员
public event EventHandler<ExternalDataEventArgs> MyEvent1;
#endregion
}
- ››改善SQL Server的内存管理
- ››WF 4.0 beta1中的跟踪机制
- ››WF 4.0的建模风格:顺序和Flowchart
- ››WF4.0 Beta1之旅(5):规则引擎的变化
- ››WF 4.0 beta1活动概览(1):Procedural
- ››WF4.0 Beta1之旅(4):Bookmark的使用
- ››WF4.0 Beta1之旅:基本介绍
- ››WF4.0 Beta1之旅(2):异常处理
- ››WF4.0 Beta1之旅(3):全新的FlowChart
- ››WF 应用场景指南: SharePoint 与工作流(上)
- ››WF 应用场景指南: 展现流(Presentation Flow)
- ››WF单元测试系列1:测试基本的Activity
更多精彩
赞助商链接