Ejemplo n.º 1
0
 public IBackgroundTask UpdateCategories(CategoryManager p_cmCategoryManager, IProfileManager p_pmProfileManager, ConfirmActionMethod p_camConfirm)
 {
     if (ModRepository.UserStatus != null)
     {
         CategoriesUpdateCheckTask cutCategoriesUpdateCheck = new CategoriesUpdateCheckTask(p_cmCategoryManager, p_pmProfileManager, ModRepository, CurrentGameModeModDirectory);
         cutCategoriesUpdateCheck.Update(p_camConfirm);
         return(cutCategoriesUpdateCheck);
     }
     else
     {
         throw new Exception("Login required");
     }
 }
Ejemplo n.º 2
0
        public async Task AsyncUpdateCategoriesTask(CategoriesUpdateCheckTask p_cutCategoriesUpdateCheck, ConfirmActionMethod p_camConfirm)
        {
            int intRetry = 0;

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

                if (LoginTask.LoggedIn)
                {
                    p_cutCategoriesUpdateCheck.Update(p_camConfirm);
                    UpdateCategoriesCheckStarted(this, new EventArgs <IBackgroundTask>(p_cutCategoriesUpdateCheck));
                    break;
                }
                else
                {
                    intRetry++;
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Runs the managed updaters.
        /// </summary>
        /// <param name="p_lstModList">The list of mods we need to update.</param>
        /// <param name="p_camConfirm">The delegate to call to confirm an action.</param>
        /// <param name="p_booOverrideCategorySetup">Whether to force a global update.</param>
        /// <param name="p_booMissingDownloadId">Whether to just look for missing download IDs.</param>
        /// <returns>The background task that will run the updaters.</returns>
        public void AsyncUpdateCategories(CategoryManager p_cmCategoryManager, IProfileManager p_pmProfileManager, ConfirmActionMethod p_camConfirm)
        {
            CategoriesUpdateCheckTask cutCategoriesUpdateCheck = new CategoriesUpdateCheckTask(p_cmCategoryManager, p_pmProfileManager, ModRepository, CurrentGameModeModDirectory);

            AsyncUpdateCategoriesTask(cutCategoriesUpdateCheck, p_camConfirm);
        }