Inheritance: ThreadedBackgroundTask
Exemplo n.º 1
0
        /// <summary>
        /// Runs the managed updaters.
        /// </summary>
        /// <param name="modList">The list of mods we need to update.</param>
        /// <param name="confirm">The delegate to call to confirm an action.</param>
        /// <param name="overrideCategorySetup">Whether to force a global update.</param>
        /// <param name="missingDownloadId">Whether to just look for missing download IDs.</param>
        /// <returns>The background task that will run the updaters.</returns>
        public IBackgroundTask UpdateMods(List <IMod> modList, IProfileManager profileManager, ConfirmActionMethod confirm, string period, bool overrideCategorySetup, bool?missingDownloadId)
        {
            if (ModRepository.UserStatus != null)
            {
                var modUpdateCheck = new ModUpdateCheckTask(AutoUpdater, profileManager, ModRepository, modList, period, overrideCategorySetup, missingDownloadId, EnvironmentInfo.Settings.OverrideLocalModNames);
                modUpdateCheck.Update(confirm);

                return(modUpdateCheck);
            }

            throw new Exception("Login required");
        }
Exemplo n.º 2
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 IBackgroundTask UpdateMods(List <IMod> p_lstModList, IProfileManager p_pmProfileManager, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup, bool?p_booMissingDownloadId)
 {
     if (ModRepository.UserStatus != null)
     {
         ModUpdateCheckTask mutModUpdateCheck = new ModUpdateCheckTask(AutoUpdater, p_pmProfileManager, ModRepository, p_lstModList, p_booOverrideCategorySetup, p_booMissingDownloadId, EnvironmentInfo.Settings.OverrideLocalModNames);
         mutModUpdateCheck.Update(p_camConfirm);
         return(mutModUpdateCheck);
     }
     else
     {
         throw new Exception("Login required");
     }
 }
 /// <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>
 /// <returns>The background task that will run the updaters.</returns>
 public IBackgroundTask UpdateMods(List <IMod> p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup)
 {
     if (ModRepository.UserStatus != null)
     {
         ModUpdateCheckTask mutModUpdateCheck = new ModUpdateCheckTask(AutoUpdater, ModRepository, p_lstModList, p_booOverrideCategorySetup);
         mutModUpdateCheck.Update(p_camConfirm);
         return(mutModUpdateCheck);
     }
     else
     {
         throw new Exception("Login required");
     }
 }
Exemplo n.º 4
0
        public async Task AsyncUpdateModsTask(ModUpdateCheckTask p_mutModUpdateCheck, ConfirmActionMethod p_camConfirm)
        {
            int intRetry = 0;

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

                if (LoginTask.LoggedIn)
                {
                    p_mutModUpdateCheck.Update(p_camConfirm);
                    UpdateCheckStarted(this, new EventArgs <IBackgroundTask>(p_mutModUpdateCheck));
                    break;
                }
                else
                {
                    intRetry++;
                }
            }
        }
Exemplo n.º 5
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 AsyncUpdateMods(List <IMod> p_lstModList, IProfileManager p_pmProfileManager, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup, bool?p_booMissingDownloadId)
        {
            ModUpdateCheckTask mutModUpdateCheck = new ModUpdateCheckTask(AutoUpdater, p_pmProfileManager, ModRepository, p_lstModList, p_booOverrideCategorySetup, p_booMissingDownloadId, EnvironmentInfo.Settings.OverrideLocalModNames);

            AsyncUpdateModsTask(mutModUpdateCheck, p_camConfirm);
        }
Exemplo n.º 6
0
        public async Task AsyncUpdateModsTask(ModUpdateCheckTask p_mutModUpdateCheck, ConfirmActionMethod p_camConfirm)
        {
            int intRetry = 0;

            while (intRetry < 5)
            {
                await Task.Delay(3000);
                if (LoginTask.LoggedIn)
                {
                    p_mutModUpdateCheck.Update(p_camConfirm);
                    UpdateCheckStarted(this, new EventArgs<IBackgroundTask>(p_mutModUpdateCheck));
                    break;
                }
                else
                    intRetry++;
            }
        }
Exemplo n.º 7
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>
 /// <returns>The background task that will run the updaters.</returns>
 public void AsyncUpdateMods(List<IMod> p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup)
 {
     ModUpdateCheckTask mutModUpdateCheck = new ModUpdateCheckTask(AutoUpdater, ModRepository, p_lstModList, p_booOverrideCategorySetup);
     AsyncUpdateModsTask(mutModUpdateCheck, p_camConfirm);
 }
Exemplo n.º 8
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>
		/// <returns>The background task that will run the updaters.</returns>
		public IBackgroundTask UpdateMods(List<IMod> p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup)
		{
			if (ModRepository.UserStatus != null)
			{
				ModUpdateCheckTask mutModUpdateCheck = new ModUpdateCheckTask(AutoUpdater, ModRepository, p_lstModList, p_booOverrideCategorySetup);
				mutModUpdateCheck.Update(p_camConfirm);
				return mutModUpdateCheck;
			}
			else
				throw new Exception("Login required");
		}
        /// <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>
        /// <returns>The background task that will run the updaters.</returns>
        public void AsyncUpdateMods(List <IMod> p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup)
        {
            ModUpdateCheckTask mutModUpdateCheck = new ModUpdateCheckTask(AutoUpdater, ModRepository, p_lstModList, p_booOverrideCategorySetup);

            AsyncUpdateModsTask(mutModUpdateCheck, p_camConfirm);
        }