<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.einbu.no/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:georss="http://www.georss.org/georss" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for Arjans blog</title>
	
	<link>http://blog.einbu.no</link>
	<description>Arjan: Technical Learnings of Programmings for Make Benefit Glorious Framework of .NET</description>
	<lastBuildDate>Sat, 17 Dec 2011 08:36:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.einbu.no/aeinbu/comments" /><feedburner:info uri="aeinbu/comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by Jaime</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/TkiKOM_iUzc/</link>
		<dc:creator>Jaime</dc:creator>
		<pubDate>Sat, 17 Dec 2011 08:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1244</guid>
		<description>This looks pretty good. I couldn't figure out how to work this out where the root element is not a hierarchical type. In my case a ProjectTemplate has a Folders collection and the Folder objects in the Folders collections also contain collections of folders.

Can someone improve upon my solution as I worked it out below to make it a little more elegate(ie remove the result list from the recursive function.

    public static class ProjectTemplateExtensions
    {
        public static IEnumerable RazorTemplates(this ProjectTemplate projectTemplate)
        {
            var razorTemplates = new List();
            foreach (var folder in projectTemplate.Folders)
            {
                PopulateRazorTemplates(folder, ref razorTemplates);
            }
        }


        public static void PopulateRazorTemplates(Folder folder, ref List razorTemplates)
        {
            razorTemplates.AddRange(folder.RazorTemplates);

            foreach (var childFolder in folder.Folders)
            {
                PopulateRazorTemplates( childFolder, ref razorTemplates);
            }
        }
    }</description>
		<content:encoded><![CDATA[<p>This looks pretty good. I couldn&#8217;t figure out how to work this out where the root element is not a hierarchical type. In my case a ProjectTemplate has a Folders collection and the Folder objects in the Folders collections also contain collections of folders.</p>
<p>Can someone improve upon my solution as I worked it out below to make it a little more elegate(ie remove the result list from the recursive function.</p>
<p>    public static class ProjectTemplateExtensions<br />
    {<br />
        public static IEnumerable RazorTemplates(this ProjectTemplate projectTemplate)<br />
        {<br />
            var razorTemplates = new List();<br />
            foreach (var folder in projectTemplate.Folders)<br />
            {<br />
                PopulateRazorTemplates(folder, ref razorTemplates);<br />
            }<br />
        }</p>
<p>        public static void PopulateRazorTemplates(Folder folder, ref List razorTemplates)<br />
        {<br />
            razorTemplates.AddRange(folder.RazorTemplates);</p>
<p>            foreach (var childFolder in folder.Folders)<br />
            {<br />
                PopulateRazorTemplates( childFolder, ref razorTemplates);<br />
            }<br />
        }<br />
    }</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/TkiKOM_iUzc" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1244</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by aeinbu</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/Gk7QnCHUeO4/</link>
		<dc:creator>aeinbu</dc:creator>
		<pubDate>Thu, 20 Oct 2011 06:43:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1240</guid>
		<description>In &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.aspx" rel="nofollow"&gt;MSDN&lt;/a&gt; it says that the Control class exposes a Controls collection. The example in the last codeblock in the article should work!</description>
		<content:encoded><![CDATA[<p>In <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.aspx" rel="nofollow">MSDN</a> it says that the Control class exposes a Controls collection. The example in the last codeblock in the article should work!</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/Gk7QnCHUeO4" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1240</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by Robson Rocha</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/dXD4Yw2KEog/</link>
		<dc:creator>Robson Rocha</dc:creator>
		<pubDate>Thu, 20 Oct 2011 01:56:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1239</guid>
		<description>How can you use it with the Controls collection of the System.Web.UI.Control class?

It does not expose an sub-list, but the elements exposed by the Controls colection expose the Controls property.</description>
		<content:encoded><![CDATA[<p>How can you use it with the Controls collection of the System.Web.UI.Control class?</p>
<p>It does not expose an sub-list, but the elements exposed by the Controls colection expose the Controls property.</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/dXD4Yw2KEog" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1239</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by aeinbu</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/PfXHr1qBmI4/</link>
		<dc:creator>aeinbu</dc:creator>
		<pubDate>Fri, 16 Sep 2011 22:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1201</guid>
		<description>Hi Gary!

I did your homework (in C#) ;) I made a new class LevelAndData, which is used both internally in the new &lt;code&gt;FlattenHierarchyWithLevels&lt;/code&gt; method and as the return type.

I think this does what you ask:

&lt;pre lang="csharp"&gt;public static class LinqToHierarchical
{
	public class LevelAndData&lt;T&gt;
	{
		public int Level { get; set; }
		public T Data { get; set; }
	}

	public static IEnumerable&lt;LevelAndData&lt;T&gt;&gt; FlattenHierarchyWithLevel&lt;T&gt;(this T node, Func&lt;T, IEnumerable&lt;T&gt;&gt; getChildEnumerator)
	{
		yield return new LevelAndData&lt;T&gt; {Level = 1, Data = node};
		if (getChildEnumerator(node) != null)
		{
			foreach (var child in getChildEnumerator(node))
			{
				foreach (var childOrDescendant in child.FlattenHierarchyWithLevel(getChildEnumerator))
				{
					yield return new LevelAndData&lt;T&gt;{ Level = childOrDescendant.Level+1, Data = childOrDescendant.Data};
				}
			}
		}
	}
}
&lt;/pre&gt;
Here's how to use it:
&lt;pre lang="csharp"&gt;class Program
{
	private static void Main(string[] args)
	{
		var q = from directory in new DirectoryInfo(@"c:\")
					.FlattenHierarchyWithLevel(x =&gt; x.GetDirectories())
				select directory;

		foreach (var levelAndData in q.Take(10))
		{
			Console.WriteLine(levelAndData.Level + " - " + levelAndData.Data.Name);
		}

		Console.WriteLine("\nPress ENTER...");
		Console.ReadLine();
	}
}
&lt;/pre&gt;
You'll need to VB-ify it yourself. Hope it helps!</description>
		<content:encoded><![CDATA[<p>Hi Gary!</p>
<p>I did your homework (in C#) ;) I made a new class LevelAndData, which is used both internally in the new <code>FlattenHierarchyWithLevels</code> method and as the return type.</p>
<p>I think this does what you ask:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">class</span> LinqToHierarchical
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> LevelAndData<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> Level <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
		<span style="color: #0600FF;">public</span> T Data <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> IEnumerable<span style="color: #008000;">&lt;</span>LevelAndData<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;&gt;</span> FlattenHierarchyWithLevel<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span> T node, Func<span style="color: #008000;">&lt;</span>T, IEnumerable<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;&gt;</span> getChildEnumerator<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		yield <span style="color: #0600FF;">return</span> <span style="color: #008000;">new</span> LevelAndData<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span> <span style="color: #000000;">&#123;</span>Level <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span>, Data <span style="color: #008000;">=</span> node<span style="color: #000000;">&#125;</span><span style="color: #008000;">;</span>
		<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>getChildEnumerator<span style="color: #000000;">&#40;</span>node<span style="color: #000000;">&#41;</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>var child <span style="color: #0600FF;">in</span> getChildEnumerator<span style="color: #000000;">&#40;</span>node<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>var childOrDescendant <span style="color: #0600FF;">in</span> child.<span style="color: #0000FF;">FlattenHierarchyWithLevel</span><span style="color: #000000;">&#40;</span>getChildEnumerator<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					yield <span style="color: #0600FF;">return</span> <span style="color: #008000;">new</span> LevelAndData<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#123;</span> Level <span style="color: #008000;">=</span> childOrDescendant.<span style="color: #0000FF;">Level</span><span style="color: #008000;">+</span><span style="color: #FF0000;">1</span>, Data <span style="color: #008000;">=</span> childOrDescendant.<span style="color: #0000FF;">Data</span><span style="color: #000000;">&#125;</span><span style="color: #008000;">;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Here&#8217;s how to use it:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">class</span> Program
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		var q <span style="color: #008000;">=</span> from directory <span style="color: #0600FF;">in</span> <span style="color: #008000;">new</span> DirectoryInfo<span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;c:\&quot;</span><span style="color: #000000;">&#41;</span>
					.<span style="color: #0000FF;">FlattenHierarchyWithLevel</span><span style="color: #000000;">&#40;</span>x <span style="color: #008000;">=&gt;</span> x.<span style="color: #0000FF;">GetDirectories</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
				select directory<span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>var levelAndData <span style="color: #0600FF;">in</span> q.<span style="color: #0000FF;">Take</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>levelAndData.<span style="color: #0000FF;">Level</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; - &quot;</span> <span style="color: #008000;">+</span> levelAndData.<span style="color: #0000FF;">Data</span>.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\n</span>Press ENTER...&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		Console.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>You&#8217;ll need to VB-ify it yourself. Hope it helps!</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/PfXHr1qBmI4" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1201</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by Gary Morris</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/5my2N56usow/</link>
		<dc:creator>Gary Morris</dc:creator>
		<pubDate>Fri, 16 Sep 2011 04:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1200</guid>
		<description>Yes, the problem for the way I am doing it now is not knowing until runtime how deep the levels go.

I was a "C" programmer for more than a decade but have become much more comfortable using VB.net.

I like the idea of having recursive calls because then I dont have to code for each level, but am struggling with your suggestion of how to return the depth.

Would it be just add one to the current depth on each return?

Could you post a little snippet (in vb 2010) of how that would be done?

I am really intrigued by your concept of flatting the hiearachy. Seems much more elegant than the way I am doing it now but keeping track of which level I am in and reading the next node to see if there are any children. The way I am doing it now, I have to know ahead of time how many levels to program for. Ugh...

Any futher help would be very much appreciated.</description>
		<content:encoded><![CDATA[<p>Yes, the problem for the way I am doing it now is not knowing until runtime how deep the levels go.</p>
<p>I was a &#8220;C&#8221; programmer for more than a decade but have become much more comfortable using VB.net.</p>
<p>I like the idea of having recursive calls because then I dont have to code for each level, but am struggling with your suggestion of how to return the depth.</p>
<p>Would it be just add one to the current depth on each return?</p>
<p>Could you post a little snippet (in vb 2010) of how that would be done?</p>
<p>I am really intrigued by your concept of flatting the hiearachy. Seems much more elegant than the way I am doing it now but keeping track of which level I am in and reading the next node to see if there are any children. The way I am doing it now, I have to know ahead of time how many levels to program for. Ugh&#8230;</p>
<p>Any futher help would be very much appreciated.</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/5my2N56usow" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1200</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by aeinbu</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/8U7aQNXdrz0/</link>
		<dc:creator>aeinbu</dc:creator>
		<pubDate>Wed, 14 Sep 2011 18:29:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1199</guid>
		<description>Hi Gary!

Putting the results in a list, would allow you to walk to next or previous node with the indexer. But part of your problem is that you don't have the depth/level of the original node.

Well, this article is really about flattening the hierarchy, so any information about depth or level in the hierarchy will be lost.

You can however modify my code, and add a level counter mechanism to it. The steps would be something like this:
1. Take in an aditional parameter to the FlattenHierarchy method. (int depth)
2. On both yield return statements you could return a new object that has both the depth+1 and the data to return.
3. Modify the calls to the FlattenHierarchy method to include current depth.

Hope this helps you on your way!</description>
		<content:encoded><![CDATA[<p>Hi Gary!</p>
<p>Putting the results in a list, would allow you to walk to next or previous node with the indexer. But part of your problem is that you don&#8217;t have the depth/level of the original node.</p>
<p>Well, this article is really about flattening the hierarchy, so any information about depth or level in the hierarchy will be lost.</p>
<p>You can however modify my code, and add a level counter mechanism to it. The steps would be something like this:<br />
1. Take in an aditional parameter to the FlattenHierarchy method. (int depth)<br />
2. On both yield return statements you could return a new object that has both the depth+1 and the data to return.<br />
3. Modify the calls to the FlattenHierarchy method to include current depth.</p>
<p>Hope this helps you on your way!</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/8U7aQNXdrz0" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1199</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by Gary Morris</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/9zTMZTOT_L8/</link>
		<dc:creator>Gary Morris</dc:creator>
		<pubDate>Wed, 14 Sep 2011 14:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1198</guid>
		<description>I should have given the additional level of the drive. It is the drive level that really complicates things:

E:\DVDs
–Awaydays
–Dog Days
–Die Hard Series
—-Die Hard 1
—-Die Hard 2
—-Die Hard 3
–Get Smart
–Happy Gilmore
F:\DVDs

I have tried using a recursive call down the tree and storing that in a List(of T), but the problem comes in trying to assign the Selected method to the List...

TreeView1.Selected = t_myDVDs.MovieName 

Should I store a List(of Nodes) perhaps?

By traversing the List instead of the tree, it would seem to make the "Previous" trip back up the tree less complicated, yes?

Please help. I have been fighting this for days.</description>
		<content:encoded><![CDATA[<p>I should have given the additional level of the drive. It is the drive level that really complicates things:</p>
<p>E:\DVDs<br />
–Awaydays<br />
–Dog Days<br />
–Die Hard Series<br />
—-Die Hard 1<br />
—-Die Hard 2<br />
—-Die Hard 3<br />
–Get Smart<br />
–Happy Gilmore<br />
F:\DVDs</p>
<p>I have tried using a recursive call down the tree and storing that in a List(of T), but the problem comes in trying to assign the Selected method to the List&#8230;</p>
<p>TreeView1.Selected = t_myDVDs.MovieName </p>
<p>Should I store a List(of Nodes) perhaps?</p>
<p>By traversing the List instead of the tree, it would seem to make the &#8220;Previous&#8221; trip back up the tree less complicated, yes?</p>
<p>Please help. I have been fighting this for days.</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/9zTMZTOT_L8" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1198</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by Gary Morris</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/WePXmxt7akk/</link>
		<dc:creator>Gary Morris</dc:creator>
		<pubDate>Tue, 13 Sep 2011 20:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-1197</guid>
		<description>What I cant find is a way to traverse a tree with a "Next" and "Previous" button.

I can do it to a certian degree, but it has problems.

The problem occurs when you step into a child. For example.

+MyDVDs
--Awaydays
--Dog Days
--Die Hard Series
----Die Hard 1
----Die Hard 2
----Die Hard 3
--Get Smart
--Happy Gilmore

How can I click "Next" and have it traverse down the tree, one step at a time, and then at any point, traverse back up the tree?

Please help.</description>
		<content:encoded><![CDATA[<p>What I cant find is a way to traverse a tree with a &#8220;Next&#8221; and &#8220;Previous&#8221; button.</p>
<p>I can do it to a certian degree, but it has problems.</p>
<p>The problem occurs when you step into a child. For example.</p>
<p>+MyDVDs<br />
&#8211;Awaydays<br />
&#8211;Dog Days<br />
&#8211;Die Hard Series<br />
&#8212;-Die Hard 1<br />
&#8212;-Die Hard 2<br />
&#8212;-Die Hard 3<br />
&#8211;Get Smart<br />
&#8211;Happy Gilmore</p>
<p>How can I click &#8220;Next&#8221; and have it traverse down the tree, one step at a time, and then at any point, traverse back up the tree?</p>
<p>Please help.</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/WePXmxt7akk" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-1197</feedburner:origLink></item>
	<item>
		<title>Comment on Authenticating against Azure Table Storage by Azure Storage Table - Query Tables | hothero's TechNote</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/xzXDq278sBA/</link>
		<dc:creator>Azure Storage Table - Query Tables | hothero's TechNote</dc:creator>
		<pubDate>Wed, 09 Mar 2011 11:49:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=477#comment-1177</guid>
		<description>[...] http://blog.einbu.no/2009/08/authenticating-against-azure-table-storage/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://blog.einbu.no/2009/08/authenticating-against-azure-table-storage/" rel="nofollow">http://blog.einbu.no/2009/08/authenticating-against-azure-table-storage/</a> [...]</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/xzXDq278sBA" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/08/authenticating-against-azure-table-storage/comment-page-1/#comment-1177</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by Anonymous</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/efoOQYqHQCY/</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 19 Jan 2011 17:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-952</guid>
		<description>Converted to vb.net...

Imports System.Runtime.CompilerServices
Imports System.IO

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim ctrls = From ctrl In CType(Me, Control).FlattenHierarchy(Function(x As Control) x.Controls.Cast(Of Control)())
        Select ctrl

        Dim directories = From directory In New DirectoryInfo("C:\temp").FlattenHierarchy(Function(x As DirectoryInfo) x.GetDirectories())
        Select directory.FullName

    End Sub
End Class


Module X
     _
    Public Function FlattenHierarchy(Of T)(ByVal node As T, ByVal getChildEnumerator As System.Func(Of T, IEnumerable(Of T))) As IEnumerable(Of T)
        Dim q As New List(Of T) From {node}
        Dim children As IEnumerable(Of T) = getChildEnumerator(node)

        If children IsNot Nothing Then
            For Each child As T In children
                For Each childOrDescendant In child.FlattenHierarchy(getChildEnumerator)
                    q.Add(childOrDescendant)
                Next
            Next
        End If

        Return q
    End Function
End Module</description>
		<content:encoded><![CDATA[<p>Converted to vb.net&#8230;</p>
<p>Imports System.Runtime.CompilerServices<br />
Imports System.IO</p>
<p>Public Class Form1</p>
<p>    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load</p>
<p>        Dim ctrls = From ctrl In CType(Me, Control).FlattenHierarchy(Function(x As Control) x.Controls.Cast(Of Control)())<br />
        Select ctrl</p>
<p>        Dim directories = From directory In New DirectoryInfo(&#8220;C:\temp&#8221;).FlattenHierarchy(Function(x As DirectoryInfo) x.GetDirectories())<br />
        Select directory.FullName</p>
<p>    End Sub<br />
End Class</p>
<p>Module X<br />
     _<br />
    Public Function FlattenHierarchy(Of T)(ByVal node As T, ByVal getChildEnumerator As System.Func(Of T, IEnumerable(Of T))) As IEnumerable(Of T)<br />
        Dim q As New List(Of T) From {node}<br />
        Dim children As IEnumerable(Of T) = getChildEnumerator(node)</p>
<p>        If children IsNot Nothing Then<br />
            For Each child As T In children<br />
                For Each childOrDescendant In child.FlattenHierarchy(getChildEnumerator)<br />
                    q.Add(childOrDescendant)<br />
                Next<br />
            Next<br />
        End If</p>
<p>        Return q<br />
    End Function<br />
End Module</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/efoOQYqHQCY" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-952</feedburner:origLink></item>
	<item>
		<title>Comment on Traverse a hierarchical structure with LINQ-to-Hierarchical by C# alternative for Ruby’s acts_as_tree, part 2 • Onderweg Blog</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/evA5hvEaIAg/</link>
		<dc:creator>C# alternative for Ruby’s acts_as_tree, part 2 • Onderweg Blog</dc:creator>
		<pubDate>Mon, 08 Nov 2010 22:51:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=353#comment-948</guid>
		<description>[...] Traverse a hierarchical structure with LINQ-to-Hierarchical (or how to flatten a tree with Linq).          Filed in C# .NET, Theory  Tags: C#, extension methods, language features, ruby  1 Comment » [...]</description>
		<content:encoded><![CDATA[<p>[...] Traverse a hierarchical structure with LINQ-to-Hierarchical (or how to flatten a tree with Linq).          Filed in C# .NET, Theory  Tags: C#, extension methods, language features, ruby  1 Comment &#187; [...]</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/evA5hvEaIAg" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/traverse-a-hierarchy-with-linq-to-hierarchical/comment-page-1/#comment-948</feedburner:origLink></item>
	<item>
		<title>Comment on Custom ASP.NET DataSource parameters by bechir</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/xhCVKCj7BzM/</link>
		<dc:creator>bechir</dc:creator>
		<pubDate>Fri, 19 Feb 2010 14:16:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=747#comment-910</guid>
		<description>Ok,
I saw the article and I tried to register the custom parameter according to the two ways or alternatives that you propose, but the tag prefix doesn't appear in the intellisense and the custom control is not recongised by ASP, so what should one do in this case</description>
		<content:encoded><![CDATA[<p>Ok,<br />
I saw the article and I tried to register the custom parameter according to the two ways or alternatives that you propose, but the tag prefix doesn&#8217;t appear in the intellisense and the custom control is not recongised by ASP, so what should one do in this case</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/xhCVKCj7BzM" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2010/02/custom-asp-net-datasource-parameters/comment-page-1/#comment-910</feedburner:origLink></item>
	<item>
		<title>Comment on Diving deeper into Windows Azure table storage by Deylo Woo</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/WOR_ESAzp3Y/</link>
		<dc:creator>Deylo Woo</dc:creator>
		<pubDate>Thu, 29 Oct 2009 22:30:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=443#comment-751</guid>
		<description>I wonder myself.  I hope they come up with a rich API.</description>
		<content:encoded><![CDATA[<p>I wonder myself.  I hope they come up with a rich API.</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/WOR_ESAzp3Y" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/09/diving-deeper-into-windows-azure-table-storage/comment-page-1/#comment-751</feedburner:origLink></item>
	<item>
		<title>Comment on What is the fascination with Twitter? by farbige kontaktlinsen</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/SJYVEWMQYEk/</link>
		<dc:creator>farbige kontaktlinsen</dc:creator>
		<pubDate>Tue, 20 Oct 2009 17:29:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=502#comment-736</guid>
		<description>Twitter is really a great invention, but I think blogging is even more important to create some traffic. But I can use some of the tips.</description>
		<content:encoded><![CDATA[<p>Twitter is really a great invention, but I think blogging is even more important to create some traffic. But I can use some of the tips.</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/SJYVEWMQYEk" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/08/what-is-the-fascination-with-twitter/comment-page-1/#comment-736</feedburner:origLink></item>
	<item>
		<title>Comment on Authenticating against Azure Table Storage by Diving deeper into Windows Azure table storage | Arjans blog</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/NPP-ilI8Nus/</link>
		<dc:creator>Diving deeper into Windows Azure table storage | Arjans blog</dc:creator>
		<pubDate>Mon, 14 Sep 2009 06:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=477#comment-560</guid>
		<description />
		<content:encoded><![CDATA[<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/NPP-ilI8Nus" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/08/authenticating-against-azure-table-storage/comment-page-1/#comment-560</feedburner:origLink></item>
	<item>
		<title>Comment on Authenticating against Azure Table Storage by Ari Block</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/U3RYs3QXOYY/</link>
		<dc:creator>Ari Block</dc:creator>
		<pubDate>Sun, 13 Sep 2009 01:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=477#comment-556</guid>
		<description>very cool blog</description>
		<content:encoded><![CDATA[<p>very cool blog</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/U3RYs3QXOYY" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/08/authenticating-against-azure-table-storage/comment-page-1/#comment-556</feedburner:origLink></item>
	<item>
		<title>Comment on What is the fascination with Twitter? by john einbu</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/2NRR7IW3_0A/</link>
		<dc:creator>john einbu</dc:creator>
		<pubDate>Sat, 05 Sep 2009 06:06:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=502#comment-512</guid>
		<description>A very readable and informative communication on this relatively new phenomenon on internet</description>
		<content:encoded><![CDATA[<p>A very readable and informative communication on this relatively new phenomenon on internet</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/2NRR7IW3_0A" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/08/what-is-the-fascination-with-twitter/comment-page-1/#comment-512</feedburner:origLink></item>
	<item>
		<title>Comment on Parsing textfiles with LINQ (or LINQ-to-TextReader) by The trouble with delimited « Arjans blog</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/fh7vv4wydCI/</link>
		<dc:creator>The trouble with delimited « Arjans blog</dc:creator>
		<pubDate>Fri, 31 Jul 2009 09:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=118#comment-308</guid>
		<description>[...] this previous article articles about parsing files, I took a very simplistic approach to reading a delimited file. I used string.Split, which [...]</description>
		<content:encoded><![CDATA[<p>[...] this previous article articles about parsing files, I took a very simplistic approach to reading a delimited file. I used string.Split, which [...]</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/fh7vv4wydCI" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/03/parsing-textfiles-with-linq/comment-page-1/#comment-308</feedburner:origLink></item>
	<item>
		<title>Comment on My first batch of photos on Flickr by aeinbu</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/FxSnBSLsqZQ/</link>
		<dc:creator>aeinbu</dc:creator>
		<pubDate>Sat, 25 Jul 2009 12:41:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=406#comment-176</guid>
		<description>If you want to comment on the pictures, please do so over at Flickr.com/aeinbu</description>
		<content:encoded><![CDATA[<p>If you want to comment on the pictures, please do so over at Flickr.com/aeinbu</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/FxSnBSLsqZQ" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/my-first-batch-of-photos-on-flickr/comment-page-1/#comment-176</feedburner:origLink></item>
	<item>
		<title>Comment on Mythbusters: Unit-testing by Per-Ove</title>
		<link>http://feeds.einbu.no/~r/aeinbu/comments/~3/5kmw9AEaP0Y/</link>
		<dc:creator>Per-Ove</dc:creator>
		<pubDate>Wed, 08 Jul 2009 02:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.einbu.no/?p=276#comment-65</guid>
		<description>I like the way you think.

...and you obviously understand how most people think or feel challenged on the subject.

I also like the part where you encourage some tests rather than none. After a while you  and your team might understand their true value, what works and what does not...</description>
		<content:encoded><![CDATA[<p>I like the way you think.</p>
<p>&#8230;and you obviously understand how most people think or feel challenged on the subject.</p>
<p>I also like the part where you encourage some tests rather than none. After a while you  and your team might understand their true value, what works and what does not&#8230;</p>
<img src="http://feeds.feedburner.com/~r/aeinbu/comments/~4/5kmw9AEaP0Y" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://blog.einbu.no/2009/07/myth-busting-unit-testing/comment-page-1/#comment-65</feedburner:origLink></item>
</channel>
</rss>

