Ejemplo n.º 1
0
        /// <summary>
        /// Execute all the process from downloading the driver to UnZip all the files related to it
        /// </summary>
        /// /// <param name="version">The current version to download</param>
        /// <param name="directoryPath">The directory to download the file</param>
        /// <param name="system"></param>
        /// <returns>Return the file Path of the current driver instance</returns>
        public static async Task <string> DownloadAndUnzip(this IDriverDownloader driverDownloader,
                                                           string version, string directoryPath, SystemType system)
        {
            string filePath = await driverDownloader.DownLoad(version, directoryPath, system);

            driverDownloader.UnZipDriverFile(filePath);
            return(filePath);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Execute all the process from downloading the driver to UnZip all the files related to it
        /// </summary>
        /// <param name="directoryPath">The directory to download the file</param>
        /// <param name="system"></param>
        /// <param name="driverFileCallback">
        /// A callback with the driver file Path as a param</param>
        public static async Task <string> DownloadAndUnzip(this IDriverDownloader driverDownloader,
                                                           string directoryPath, SystemType system, Action <string> driverFileCallback)
        {
            string filePath = await driverDownloader.DownLoad(await driverDownloader.GetLastestVersion(),
                                                              directoryPath, system);

            driverDownloader.UnZipDriverFile(filePath);
            driverFileCallback(filePath);

            return(filePath);
        }