private MethodInfo GetMethod(Type type, string name) { MethodInfo method = type.GetMethod(name); if (method == null) throw new InvalidProgramException("Method " + name + " not found in compiled rule " + type.Name + "."); return method; }