// DoWork event handler for the file download BackgroundWorker.
        // The selected TreeNode (either a module, folder, or file) is passed in the DoWorkEventArgs e
        private void DownloadBW_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker       = sender as BackgroundWorker;
            TreeNode         selectedNode = e.Argument as TreeNode;

            scraper.DownloadProgress.BeginJob(worker);

            // -- DETERMINE TYPE OF NODE SELECTED --
            // Module selected
            if (selectedNode.Tag.GetType() == typeof(BbModule))
            {
                BbModule module = selectedNode.Tag as BbModule;
                scraper.DownloadProgress.TotalWork = module.Content.CountAllFiles();
                scraper.DownloadModuleFiles(module);
            }
            // Single folder selected
            else if (selectedNode.Tag.GetType() == typeof(BbContentDirectory))
            {
                BbContentDirectory folder = selectedNode.Tag as BbContentDirectory;
                scraper.DownloadProgress.TotalWork = folder.CountAllFiles();
                scraper.DownloadFolder(folder, scraper.OutputDirectory + BbUtils.CleanDirectory(folder.Name) + @"\");
            }
            // Single file selected
            else if (selectedNode.Tag.GetType() == typeof(BbContentItem))
            {
                BbContentItem file = selectedNode.Tag as BbContentItem;
                scraper.DownloadProgress.TotalWork = 1;
                scraper.DownloadFile(file);
            }
        }
        public static void ViewFile(BbContentItem file)
        {
            Console.WriteLine();
            Console.WriteLine("VIEWING FILE " + file.Name);
            Console.WriteLine("------------------------------------------------------------------");
            Console.WriteLine(file);
            Console.WriteLine("------------------------------------------------------------------");
            Console.WriteLine();
            Console.Write("Download? [Y/N]: ");
            string choice = Console.ReadLine();

            if (choice.ToUpper().StartsWith("Y"))
            {
                scraper.DownloadFile(file);
            }
            ViewDirectory(file.Folder);
        }