private AbstractTree.Method GetMethodTree(System.Reflection.MethodInfo methodInfo, object instance) { Method = new AbstractTree.Method(methodInfo.Name); Log(ConsoleColor.Yellow, $"Начало парсинга метода {Method.Name}"); methodInfo.Invoke(instance, null); foreach(var command in Method.Commands) { Log(ConsoleColor.Cyan, $" {command}"); } Log(ConsoleColor.Yellow, $"Парсинг метода {Method.Name} завершен."); return Method; }
public Module AddMethod(Method method) { Methods.Add(method); method.Module = this; return this; }