The custom class taskeventargs inherits eventargs. If the ontaskchanged control requires a custom method, define this method attribute first, designerserializationvisibilityattribute, browsableattribute, categoryattribute, and eventhandler <taskeventargs>. Code As follows:
Taskeventargs. CS Using System;
Using System. Collections. Generic;
Using System. text;
Using System. workflow. Activities;
Using Microsoft. Sharepoint. workflow;
Namespace Wfact
{
[Serializable ()]
Public ClassTaskeventargs: eventargs
{
}
}
Custom method: Public Static Dependencyproperty ontaskchanged_istaskcompleteevent = Dependencyproperty. Register ( " Ontaskchanged_istaskcomplete " , Typeof (System. eventhandler < Wfact. taskeventargs > ), Typeof (Wfact. taskactivity ));
[Designerserializationvisibilityattribute (designerserializationvisibility. Visible)]
[Browsableattribute ( True )]
[Categoryattribute ( " Taskchanged attributes " )]
Public Event Eventhandler < Taskeventargs > Ontaskchanged_istaskcomplete
{
Add
{
Base. Addhandler (ontaskchanged_istaskcompleteevent, value );
}
Remove
{
Base. Removehandler (ontaskchanged_istaskcompleteevent, value );
}
}