Example #1
0
        // recursively add directories into the media library
        void addDirRecurse(string path, Progress progress, Folder folder)
        {
            // add all files within the directory
            foreach (string file in Directory.GetFiles (path))
            {
                if (progress.Canceled) return;
                progress.Push ("Loading File: " + System.IO.Path.GetFileName (file));

                library.MediaStore.AddMedia (file, folder);

                progress.Step ();
            }

            // recurse into directories, if any
            foreach (string dir in Directory.GetDirectories (path))
            {
                if (progress.Canceled) return;
                addDirRecurse (dir, progress, folder);
            }
        }