private static void BuildDirectoryTree(MyDirectory rootDirectory)
        {
            try
            {
                var childDirectories = Directory.GetDirectories(rootDirectory.Name);
                foreach (string directory in childDirectories)
                {
                    rootDirectory.ChildDirectories.Add(new MyDirectory(directory));
                }
            }
            catch (UnauthorizedAccessException)
            {
                // Handle directories we dont have access to.
            }

            foreach (var childDirectory in rootDirectory.ChildDirectories)
            {
                MyDirectory.BuildDirectoryTree(childDirectory);
            }

            try
            {
                var files = Directory.GetFiles(rootDirectory.Name);
                foreach (string file in files)
                {
                    var info = new FileInfo(file);
                    rootDirectory.Files.Add(new MyFile(file, info.Length));
                }
            }
            catch (UnauthorizedAccessException)
            {
                // Handle files we dont have access to.
            }
        }
 public static MyDirectory GetDirectory(string path)
 {
     var directory = new MyDirectory(path);
     MyDirectory.BuildDirectoryTree(directory);
     return directory;
 }