I have a function GetDirectories() which returns me the List of directory info : Now i need to reconstruct a tree view out of it , based on the its parent
Here is my function
Getdirectories which return the
public List<DirectoryInfo> GetDirectories()
DirectoryInfo di = new DirectoryInfo("D:\\python_code");
static List<DirectoryInfo> folders = new List<DirectoryInfo>(); // List that hold direcotries that cannot be accessed
static void GetFullDirList(DirectoryInfo dir, string searchPattern)
foreach (FileInfo f in dir.GetFiles(searchPattern))
foreach (DirectoryInfo d in dir.GetDirectories())
I need something like this to be constructed from the List , which contain all the DirectoryInfo elements i.e it contains its parent info also .
so far i am trying to get the elements whose parent are same and populate it to tree view and do it recursively :
But i am not able to get the recursive function written through .
I know their other easier ways to do the same , but this is a recruitment of a big picture i am trying to draw .
any help would be extremly appretiated .