自定义被封装的工作流控件方法

自定义类 TaskEventArgs继承EventArgs,如果onTaskChanged控件需要自定义方法,那么先定义该方法属性,DesignerSerializationVisibilityAttributeBrowsableAttributeCategoryAttribute,定义EventHandler<TaskEventArgs>类型的方法,具体代码如下:
TaskEventArgs.cs
using  System;
using  System.Collections.Generic;
using  System.Text;
using  System.Workflow.Activities;
using  Microsoft.SharePoint.Workflow;

namespace  wfACT
{
    [Serializable()]
    
public class TaskEventArgs:EventArgs
    
{
    }

}

自定义方法:
public   static  DependencyProperty onTaskChanged_IsTaskCompleteEvent  =  DependencyProperty.Register( " onTaskChanged_IsTaskComplete " typeof (System.EventHandler < wfACT.TaskEventArgs > ),  typeof (wfACT.TaskActivity));
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
[BrowsableAttribute(
true )]
[CategoryAttribute(
" TaskChanged属性 " )]
public   event  EventHandler < TaskEventArgs >  onTaskChanged_IsTaskComplete
{
 add
 
{
   
base.AddHandler(onTaskChanged_IsTaskCompleteEvent, value);
 }

 remove
 
{
   
base.RemoveHandler(onTaskChanged_IsTaskCompleteEvent, value);
 }

}

你可能感兴趣的:(工作流)