实现自定义Workflow(1):在VS中创建一个Workflow
摘要 |
在本系列文章中,笔者介绍了如何使用SharePoint Designer 2007自带的Workflow设计器来设计一个Workflow。事实上,这个设计器已经可以设计非常复杂的Workflow了。 |
正文 |
为了更清楚地让朋友们了解在SharePoint中实现自定义Workflow的几个步骤,本篇文章将被分割成四个小的部分,第一部分讲解在VS中创建一个Workflow,第二部分讲解设置配置文件,第三部分讲解在Designer中创建一个Workflow,最后一部分讲解运行Workflow。因此而给大家带来的阅读不便,就请海涵了:) 1 using System; 2 using System.ComponentModel; 3 using System.ComponentModel.Design; 4 using System.Collections; 5 using System.Drawing; 6 using System.Workflow.ComponentModel.Compiler; 7 using System.Workflow.ComponentModel.Serialization; 8 using System.Workflow.ComponentModel; 9 using System.Workflow.ComponentModel.Design; 10 using System.Workflow.Runtime; 11 using System.Workflow.Activities; 12 using System.Workflow.Activities.Rules; 13 14 using System.IO; 15 16 namespace Eallies.Workflow.Demo 17 { 18 public partial class WriteFile: SequenceActivity 19 { 20 private string _Text = string.Empty; 21 22 public WriteFile() 23 { 24 InitializeComponent(); 25 } 26 27 public string Text 28 { 29 get { return this._Text; } 30 set { this._Text = value; } 31 } 32 33 private void WriteFileAction_ExecuteCode(object sender, EventArgs e) 34 { 35 string path = @"c:\Workflow.txt"; 36 string text = this._Text + "-" + DateTime.Now.ToString(); 37 StreamWriter writer = new StreamWriter(path); 38 writer.Write(text); 39 writer.Close(); 40 } 41 } 42 }
|
来源:http://www.eallies.com/