TreeExtensionMethods
Methods
public static ITree ExpandEmbeddedCollections(this ITree tree, ExpansionOptions options, params ExpansionLogic[] customExpanders)
Process a tree and automatically convert all linear enumerations and trees stored as items into new twigs and sub-trees. This method is recursive and keeps replacing embedded collections until no more changes happen.
Parameters:
| tree (ITree) | Tree to expand. |
| options (ExpansionOptions) | Expansion options. |
| customExpanders (params ExpansionLogic[]) | Collection of types to be considered as linear collections. Note that each type in this set must also implement IEnumerable or it will not be considered. |
Returns: Expanded tree, or null if no embedded collections were found.
public static ITree ExpandEmbeddedCollections(this ITree tree, params ExpansionLogic[] customExpanders)
Process a tree and automatically convert all linear enumerations and trees stored as items into new twigs and sub-trees. This method is recursive and keeps replacing embedded collections until no more changes happen.
Parameters:
| tree (ITree) | Tree to expand. |
| customExpanders (params ExpansionLogic[]) | Collection of types to be considered as linear collections. Note that each type in this set must also implement IEnumerable or it will not be considered. |
Returns: Expanded tree, or null if no embedded collections were found.
public static ITwig[] ExpandEmbeddedCollections(this ITwig twig, ExpansionOptions options, params ExpansionLogic[] customExpanders)
Process a twig and automatically convert all linear enumerations and trees stored as items into new twigs and sub-trees. This method is not recursive so must be called iteratively until no more changes are made. Consider using the overload of this method which takes an ITree and which is recursive.
Parameters:
| twig (ITwig) | Twig to expand. |
| options (ExpansionOptions) | Expansion options. Note that ExpansionOptions.Recurse and ExpansionOptions.Recurse are not relevant to this method. |
| customExpanders (params ExpansionLogic[]) | Collection of types to be considered as linear collections. Note that each type in this set must also implement IEnumerable or it will not be considered. |
Returns: Array of twigs with automatic incremental paths, or null if no embedded collections were found.
public static ITwig[] ExpandEmbeddedCollections(this ITwig twig, params ExpansionLogic[] customExpanders)
Process a twig and automatically convert all linear enumerations and trees stored as items into new twigs and sub-trees. This method is not recursive so must be called iteratively until no more changes are made. Consider using the overload of this method which takes an ITree and which is recursive.
Parameters:
| twig (ITwig) | Twig to expand. |
| customExpanders (params ExpansionLogic[]) | Collection of types to be considered as linear collections. Note that each type in this set must also implement IEnumerable or it will not be considered. |
Returns: Array of twigs with automatic incremental paths, or null if no embedded collections were found.
Find all places where IPear instances are assigned as twig items and promote them to the proper structure.
Parameters:
| tree (ITree) | Tree to repair. |
Returns: Repaired tree or null if no repairs were needed.