Пример #1
0
        /// <summary>
        /// Starts the Automatic Download.
        /// </summary>
        /// <param name="p_strPath">The path to the mod to install.</param>
        /// <param name="p_cocConfirmOverwrite">The delegate to call to resolve conflicts with existing files.</param>
        /// <returns>A background task set allowing the caller to track the progress of the operation.</returns>
        public IBackgroundTask AutomaticDownload(List <string> p_strMissingMods, ProfileManager p_pmProfileManager, ConfirmActionMethod p_camConfirm, ConfirmOverwriteCallback p_cocConfirmOverwrite)
        {
            AutomaticDownloadTask amtProfileAdder = new AutomaticDownloadTask(p_strMissingMods, this, p_pmProfileManager, p_cocConfirmOverwrite);

            amtProfileAdder.Update(p_camConfirm);
            return(amtProfileAdder);
        }
Пример #2
0
        public async void AsyncAutomaticDownloadTask(AutomaticDownloadTask p_pstAutomaticDownloadTask, ConfirmActionMethod p_camConfirm)
        {
            int intRetry = 0;

            while (intRetry < 5)
            {
                await Task.Delay(3000);

                if (LoginTask.LoggedIn)
                {
                    p_pstAutomaticDownloadTask.Update(p_camConfirm);
                    AutomaticDownloadStarted(this, new EventArgs <IBackgroundTask>(p_pstAutomaticDownloadTask));
                    break;
                }
                else
                {
                    intRetry++;
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Starts the Automatic Download.
        /// </summary>
        /// <param name="p_strPath">The path to the mod to install.</param>
        /// <param name="p_cocConfirmOverwrite">The delegate to call to resolve conflicts with existing files.</param>
        /// <returns>A background task set allowing the caller to track the progress of the operation.</returns>
        public void AsyncAutomaticDownload(List <string> p_strMissingMods, ProfileManager p_pmProfileManager, ConfirmActionMethod p_camConfirm, ConfirmOverwriteCallback p_cocConfirmOverwrite)
        {
            AutomaticDownloadTask adtAutomaticDownload = new AutomaticDownloadTask(p_strMissingMods, this, p_pmProfileManager, p_cocConfirmOverwrite);

            AsyncAutomaticDownloadTask(adtAutomaticDownload, p_camConfirm);
        }