public void Generate() { if (!Directory.Exists(directoryBox.Text)) Directory.CreateDirectory(directoryBox.Text); var methods = new List<MethodBase>(); foreach (var node in methodsBox.Nodes) ProcessNode(node as TreeNode, methods); var injector = new Injector("debugger.exe"); if (!injector.GenerateTemplates(methods, directoryBox.Text)) MessageBox.Show(injector.Errors); }