What is the IndentationSplitter?

Ever wanted to just parse a simple indented tree with some items?
It shouldn't be that hard, right?
Well.. after too many hours now its not.

Get it from Nuget

https://www.nuget.org/packages/IndentationSplitter/

How simple is it to use?

Say you want to output a tree structure into a design time view model, use this and you are ready to go:
const string designTime =
@"object1
    child
    grandchild
    anotherchild";

var rootItems = IndentationSplitter.SimpleTree
        .Parse(designTime, (name, children) => new MyTreeNode(name, children));

Want to test output from a tree generator?

var result = SimpleTree.Format(models, model => model.ToString(), model => model.Children, "\t");

Last edited Sep 18, 2014 at 2:24 PM by Almund, version 5