/// <inheritdoc/> protected override void ExecuteInternal(object parameter) { var fileName = "HelpTemplate.md"; using (var sr = new StreamWriter(fileName)) { var nodes = _nodeProvider.GetRegisteredNodes(); foreach (var node in nodes) { sr.WriteLine($"# {node.Name}"); if (node.GetType().GetCustomAttributes(typeof(HelpAttribute), true).FirstOrDefault() is HelpAttribute help) { sr.WriteLine($"{help.HelpText}"); } else { sr.WriteLine($"{node.Name} description."); } sr.WriteLine($"## Terminals"); foreach (var inputTerminal in node.Terminals.OfType <InputTerminal>()) { sr.WriteLine($"### {inputTerminal.Name}"); sr.WriteLine($"{inputTerminal.Name} description."); } foreach (var outputTerminal in node.Terminals.OfType <OutputTerminal>()) { sr.WriteLine($"### {outputTerminal.Name}"); sr.WriteLine($"{outputTerminal.Name} description."); } } sr.Close(); } OpenDirectory(); }
/// <summary> /// Populate the palette with nodes. /// </summary> public void AddNodes() { foreach (var node in _nodeProvider.GetRegisteredNodes()) { if (CanAddNodeToPalette(node)) { TryAddingNode(node); } } }