Commit Graph

4 Commits

Author SHA1 Message Date
agrath@gmail.com
ddcf34b80c Added .Sibling to DynamicNodeWalker which is a shorthand for checking both .Next() and .Previous()
overloads are .Sibling(int) [which you can pass negative to and is equivilent to .Previous(+int) ] or .Sibling(string) which checks nodeTypeAlias
.Sibling(string) will start walking forward at the current node and then wrap back to 0 until it reaches the starting point again
2011-03-08 19:54:55 -13:00
agrath@gmail.com
a02aca0f62 Added support to DynamicNodeWalker for finding nodes that are Up/Down/Previous/Next by NodeTypeAlias
Up and down are similar to Ancestors(string nodeTypeAlias)/Descendants(string nodeTypeAlias) but return the first match
2011-03-08 19:42:59 -13:00
agrath@gmail.com
d7e83cb1ee Added support to DynamicNodeWalker so that .Next() and .Previous() can be called on nodes which did not come from a DynamicNodeList (e.g. a node you have from @Model) - assuming it has a parent 2011-03-08 19:22:41 -13:00
agrath@gmail.com
71c5e35443 Added DynamicNodeWalker and implementation on DynamicNode and DynamicNodeList
DynamicNodeWalker is our secret weapon in the fight against the Rebel XSLT Alliance
Navigate nodes by calling Up(), Down(), Next() and Previous() on them
Next(1) will jump two items along within the current list, whereas Next() will walk by one within the list
Previous(1) will move two items backwards within the current list
Up() is a special wrapper around .Parent which has an overload .Up(int) to replace @Model.Parent.Parent.Parent... [.Up(2)]
Down() will take you to the first Child item and is equivilent to .Children.First(), use .Down(1) to replace .Children.First().Children
If one of the NodeWalker functions fails to find a node at the requested position, it will return null
2011-02-24 17:19:50 -13:00