///返回接口类
public IFlowCustomAction GetCustomAction(string flowName){
var fix = "LwAction";
var type =Type.GetType("Web.CustomAction." + flowName );//路径+方法名
return Dynamic.InvokeConstructor(type);//动态执行
}
IFlowCustomAction
customAction = GetCustomAction(FlowName);
customAction.LoadForm(data, this, userId);
//然后就可以调用
IFlowCustomAction
接口重写之后的方法
//
IFlowCustomAction
为接口类
type
为重写方法
//
IFlowCustomAction
.cs
public interface IFlowCustomAction
{
object LoadForm(WeiXinModel data, FlowData flow, string userId);
}
//动态方法public class LwAction: DefaultAction
{
public override object LoadForm(WeiXinModel data, FlowData flow, string userId)
{ //重写方法 }}