/// <summary> /// 导入数据 /// </summary> public virtual void LoadFun(List<FunClass> funList) { MethodInfo[] property = this.GetType().GetMethods(); for (int n = 0; n < property.Length; n++) { DelegateCodeAttribute[] dcodeattr = (DelegateCodeAttribute[])property[n].GetCustomAttributes(typeof(DelegateCodeAttribute), true); if (dcodeattr.Length > 0) { FunClass fun = new FunClass(); fun.funName = property[n].Name; fun.funCode = delegate(object[] para) { return property[n].Invoke(this, para); }; funList.Add(fun); } } }
/// <summary> /// 导入数据 /// </summary> public virtual void LoadFun(List <FunClass> funList) { MethodInfo[] property = this.GetType().GetMethods(); for (int n = 0; n < property.Length; n++) { DelegateCodeAttribute[] dcodeattr = (DelegateCodeAttribute[])property[n].GetCustomAttributes(typeof(DelegateCodeAttribute), true); if (dcodeattr.Length > 0) { FunClass fun = new FunClass(); fun.funName = property[n].Name; fun.funCode = delegate(object[] para) { return(property[n].Invoke(this, para)); }; funList.Add(fun); } } }