Browser.WalkTheTree C# (CSharp) Method

WalkTheTree() public method

public WalkTheTree ( DirectoryInfo DI ) : void
DI DirectoryInfo
return void
    void WalkTheTree(DirectoryInfo DI)
    {
        String PARENT = DI.FullName;
        DirectoryInfo[] diArr = DI.GetDirectories();
        FileInfo[] fiArr = DI.GetFiles();

        //Debug
        Path[] PathTreeTemp = new Path[ diArr.Length + fiArr.Length ];
        for (int i=0; i<diArr.Length; ++i)
        {
            //Debug.Log(diArr[i].Name);
            PathTreeTemp[i].Name = diArr[i].Name;
            PathTreeTemp[i].Parent = PARENT;
            PathTreeTemp[i].File = false;
        }
        int diArrLength = diArr.Length;
        for (int i=diArrLength; i<PathTreeTemp.Length; ++i)
        {
            PathTreeTemp[i].Name = fiArr[i-diArrLength].Name;
            PathTreeTemp[i].Parent = PARENT;
            PathTreeTemp[i].File = true;
        }

        PathTree = AddPathArrays( PathTree, PathTreeTemp);

        foreach (DirectoryInfo di in diArr)
            WalkTheTree( di );
    }