Inheritance: ICategoryManager
        /// <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);
        }
Example #2
0
		/// <summary>
		/// A simple constructor that initializes the object with its dependencies.
		/// </summary>
		/// <param name="p_mmdModManager">The mod manager to use to manage mods.</param>
		/// <param name="p_setSettings">The application and user settings.</param>
		/// <param name="p_thmTheme">The current theme to use for the views.</param>
		public ModManagerVM(ModManager p_mmdModManager, ISettings p_setSettings, Theme p_thmTheme)
		{
			ModManager = p_mmdModManager;
			ModRepository = p_mmdModManager.ModRepository;
			Settings = p_setSettings;
			CurrentTheme = p_thmTheme;
			CategoryManager = new CategoryManager(ModManager.CurrentGameModeModDirectory, "categories");
			if (this.CategoryManager.IsValidPath)
			{
				this.CategoryManager.LoadCategories(String.Empty);
				m_booIsCategoryInitialized = true;
			}
			else
				this.CategoryManager.Backup();
			AddModCommand = new Command<string>("Add Mod", "Adds a mod to the manager.", AddMod);
			DeleteModCommand = new Command<IMod>("Delete Mod", "Deletes the selected mod.", DeleteMod);
			ActivateModCommand = new Command<List<IMod>>("Activate Mod", "Activates the selected mods.", ActivateMods);
			DeactivateModCommand = new Command<List<IMod>>("Deactivate Mod", "Deactivates the selected mod.", DeactivateMods);
			TagModCommand = new Command<IMod>("Tag Mod", "Gets missing mod info.", TagMod);

			ModManager.UpdateCheckStarted += new EventHandler<EventArgs<IBackgroundTask>>(ModManager_UpdateCheckStarted);
		}
		/// <summary>
		/// Setup the CategoryView
		/// </summary>
		/// <param name="p_lvwList">The source list view.</param>
		/// <param name="p_cmgCategoryManager">The mod Category Manager.</param>
		public void Setup(ReadOnlyObservableList<IMod> p_rolManagedMods, ReadOnlyObservableList<IMod> p_rolActiveMods, IModRepository p_mmrModRepository, CategoryManager p_cmgCategoryManager, ISettings p_Settings)
		{
			this.Tag = false;

			this.CellEditActivation = CellEditActivateMode.None;
			this.MultiSelect = true;
			this.AllowDrop = true;
			this.UseFiltering = true;

			CategoryManager = p_cmgCategoryManager;
			m_mmrModRepository = p_mmrModRepository;
			m_rolManagedMods = p_rolManagedMods;
			m_rolActiveMods = p_rolActiveMods;
			Settings = p_Settings;

			// Setup menuStrip commands
			SetupContextMenu();

			// Setup category validator
			SetupCategoryValidator();

			// Setup category sorter
			SetupCategorySorter();

			this.CheckBoxes = false;
			this.UseSubItemCheckBoxes = false;
			this.BooleanCheckStateGetter = delegate(object x)
			{
				if (x.GetType() != typeof(ModCategory))
					if (m_rolActiveMods.Contains((IMod)x))
						return true;

				return false;
			};

			// Setup AspectGetter (IconListView cell parser)
			SetupColumnParser();

			// Setup the Drag&Drop functionality
			SetupDragAndDrop();

			// Setup hyperlink manager
			SetupHyperlinkManager();

			// Setup ImageGetters
			SetupImageGetters();

			// Set control initialized
			this.Tag = true;
		}