public void Download(DriveService service, string fileId, string localDestinationFilename, long fileSize, XtraForm_NewCourses parentForm)
        {
            XtraForm_NewCourses parent = parentForm;
            long totalSize             = fileSize;// 100000;

            parent.updateStatusBar(0, "Downloading...", fileId);
            try
            {
                var request = service.Files.Get(fileId);
                using (var stream = new System.IO.FileStream(localDestinationFilename, System.IO.FileMode.Create, System.IO.FileAccess.Write))
                {
                    request.MediaDownloader.ProgressChanged += (Google.Apis.Download.IDownloadProgress progress) =>
                    {
                        switch (progress.Status)
                        {
                        case Google.Apis.Download.DownloadStatus.Downloading:
                        {
                            Console.WriteLine(progress.BytesDownloaded);
                            parent.updateStatusBar((progress.BytesDownloaded * 100) / totalSize, "Downloading...", fileId);
                            break;
                        }

                        case Google.Apis.Download.DownloadStatus.Completed:
                        {
                            Console.WriteLine("Download complete.");
                            parent.updateStatusBar(-1, localDestinationFilename, fileId);
                            string[] words = localDestinationFilename.Split('_');
                            //MessageBox.Show("finished download");
                            Task.Run(() => { MyExtract(localDestinationFilename, rootPath + "//" + words[0], this, fileId); });

                            break;
                        }

                        case Google.Apis.Download.DownloadStatus.Failed:
                        {
                            MessageBox.Show("Download failed.");
                            Console.WriteLine("Download failed.");
                            break;
                        }
                        }
                    };
                    request.DownloadWithStatus(stream);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: " + e.Message);
            }
        }
        private void MyExtract(string zipToUnpack, string unpackDirectory, XtraForm_NewCourses parentForm, string fileId)
        {
            XtraForm_NewCourses parent = parentForm;
            //fileIdUnzipping = fileId;
            long filesExtracted = 0;

            bool finishedUnzip = false;

            //Ionic.Zip.ZipFile zip = Ionic.Zip.ZipFile.Read(zipToUnpack);
            using (Ionic.Zip.ZipFile zip = Ionic.Zip.ZipFile.Read(zipToUnpack))
            {
                int totalFiles = zip.Count;
                foreach (ZipEntry z in zip)
                {
                    try
                    {
                        filesExtracted++;
                        parent.updateStatusBarUnzip(100 * filesExtracted / totalFiles, "unzipping", fileId, zipToUnpack);
                        z.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently);
                    }
                    catch (Exception ex)
                    {
                        //Write ex.ToString() to file and move on...
                        Console.WriteLine(ex.ToString());
                    }
                    if (totalFiles <= filesExtracted)
                    {
                        parent.updateStatusBarUnzip(-1, "unzipping", fileId, zipToUnpack);

                        finishedUnzip = true;
                    }
                }
            }
            if (finishedUnzip == true)
            {
                if (File.Exists(zipToUnpack) == true)
                {
                    File.Delete(zipToUnpack);
                }
                updateCoursesInfo();
            }
        }