ネストされたリスト内のエンティティのID、つまりルートノードからのパスを見つけるメソッドを作成する必要があります。
public class Application
{
public string Name { get; set; }
public string Path { get; set; }
public List<Component> Components { get; set; }
}
public class Component
{
public string Name { get; set; }
public string Path
public List<Component> Components { get; set; }
}
例えば:
-Name: Windows:
-Path: "D:\Windows"
-components:
[0] Path: "Microsoft.net"
Name: ".netfolder"
Components:
[0] Path: "Framework"
Name: ".netfolder"
Components:
[0] Path: "v3.0"
Name: "3.0folder"
Components:
[1] Path: "Microsoft.net"
Name: "Framework64"
Components:
「3.0folder」をパラメーターとして使用してメソッドを呼び出すと、各ノードのノードパスが返されます。
{ "D:\Windows", "Microsoft.net", "Framework", "v3.0" }