How to filter a recursive object?
<p>In my current project, a method I don't control sends me an object of this type:</p>

<pre><code>public class SampleClass
{
    public SampleClass();

    public int ID { get; set; }
    public List&lt;SampleClass&gt; Items { get; set; }
    public string Name { get; set; }
    public SampleType Type { get; set; }
}

public enum SampleType
{
    type1,
    type2,
    type3
}
</code></pre>

<p>I display those data in a <code>TreeView</code>, but I would like to display only the path ending with <code>SampleClass</code> objects having their <code>Type</code> property set to <code>type3</code>, no matter the depth of this leaf.</p>

<p>I have absolutely no clue on how to do that, can someone help me ?</p>

<p>Thanks in advance !</p>

<h1>Edit</h1>

<p>To explain the problem I meet with the solutions proposed by Shahrooz Jefri and dasblinkenlight, here is a picture.  The left column is the original data, without filtering, and the right one is the data filtered.  Both methods provide the same result.
In red is the problem.</p>

<p><img src="http://i.stack.imgur.com/xRLTh.png" alt="enter image description here"></p>
