public static IEnumerable<MethodInfo> GetFunctionList(ModuleBase module) { var methods = from item in module.GetType().GetMethods() where (item.GetCustomAttributes(typeof(ModuleMethod), true).Length > 0) select item; return methods; }
private void RegisterModule(ModuleBase module) { string nameSpace = module.Namespace; this.NewTable(nameSpace); foreach (var method in ModuleLoader.GetFunctionList(module)) { string path = string.Format("{0}.{1}", nameSpace, method.Name); RegisterFunction(path, module, method); } }
public static string[] GetFunctionsHelp(ModuleBase module) { var methods = GetFunctionList(module); return GetFunctionsHelp(methods, module.Namespace); }
public void AddModule(ModuleBase module) { RegisterModule(module); }