Ejemplo n.º 1
0
        /// <summary>
        /// Downloads the mod from ModURL.
        /// </summary>
        /// <param name="importInfo">The ImportInfo of the mod to download.</param>
        /// <returns>True if download was successful, otherwise false.</returns>
        private static bool DownloadMod(ref ImportInfo importInfo)
        {
            ISiteHandler siteHandler = importInfo.SiteHandler;

            if (siteHandler != null)
            {
                ModInfo modInfo = siteHandler.GetModInfo(importInfo.ModURL);
                importInfo.DownloadSuccessfull = siteHandler.DownloadMod(ref modInfo);
                importInfo.ModInfo             = modInfo;
            }

            return(importInfo.DownloadSuccessfull);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Downloads the mod.
        /// </summary>
        /// <param name="modInfo">The infos of the mod. Must have at least ModURL and LocalPath</param>
        /// <param name="downloadProgressCallback">Callback function for download progress.</param>
        /// <returns>True if the mod was downloaded.</returns>
        public bool DownloadMod(ref ModInfo modInfo, DownloadProgressCallback downloadProgressCallback = null)
        {
            ISiteHandler curseForge = SiteHandlerManager.GetSiteHandlerByName("CurseForge");

            return(curseForge.DownloadMod(ref modInfo, downloadProgressCallback));
        }