Exemple #1
0
    internal virtual void list(Filesystem.DirectoryPrx dir, bool recursive, int depth)
    {
        StringBuilder b = new StringBuilder();
        for(int i = 0; i < depth; ++i)
        {
            b.Append('\t');
        }
        string indent = b.ToString();

        NodeDesc[] contents = dir.list();

        for(int i = 0; i < contents.Length; ++i)
        {
            DirectoryPrx d = contents[i].type == NodeType.DirType
                                ? DirectoryPrxHelper.uncheckedCast(contents[i].proxy) : null;
            Console.Write(indent + contents[i].name + (d != null ? " (directory)" : " (file)"));
            if(d != null && recursive)
            {
                Console.WriteLine(":");
                list(d, true, ++depth);
            }
            else
            {
                Console.WriteLine();
            }
        }
    }