public string Execute(Guid vId, string sMethodName, string[] hParams) { INebulaModule hModule = m_hModules.Where(m => m.ModuleInfo.Guid == vId).FirstOrDefault(); if (hModule == null) { return("Module Not Found"); } else { MethodInfo hMethod = hModule.GetType().GetMethods().Where(m => m.Name == sMethodName).FirstOrDefault(); if (hMethod == null) { return("Method Not Found"); } else { try { return(hMethod.Invoke(hModule, new object[] { hParams }) as string); } catch (Exception hEx) { return(hEx.ToString()); } } } }
public NebulaModuleInfo(string sName, string sGuid, INebulaModule hModule) { Name = sName; Guid = new Guid(sGuid); Methods = (from m in hModule.GetType().GetMethods() from a in m.GetCustomAttributes(true) where a.GetType() == typeof(NebulaModuleOperationAttribute) select new NebulaModuleMethod(m)).ToArray(); }