Exemple #1
0
        /// <summary>
        /// Updates the installed game mods.
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="modId"></param>
        /// <param name="region"></param>
        /// <param name="noOfFiles"></param>
        /// <param name="dateInstalled"></param>
        /// <param name="downloadFiles"></param>
        public void UpdateInstalledGameMod(string categoryId, int modId, string region, int noOfFiles, DateTime dateInstalled, DownloadFiles downloadFiles)
        {
            RemoveInstalledGameMod(categoryId);

            InstalledGameMods.Add(new InstalledMod
            {
                CategoryId    = categoryId,
                ModId         = modId,
                Region        = region,
                Files         = noOfFiles,
                DateInstalled = dateInstalled,
                DownloadFiles = downloadFiles
            });
        }
Exemple #2
0
 /// <summary>
 /// Gets the current <see cref="InstalledGameMod" /> the <see cref="ModsData.ModItem.Id" />
 /// </summary>
 /// <param name="categoryId"></param>
 /// <returns></returns>
 public InstalledMod GetInstalledGameMod(string categoryId)
 {
     return(InstalledGameMods.FirstOrDefault(mod => mod.CategoryId.Equals(categoryId, StringComparison.OrdinalIgnoreCase)));
 }
Exemple #3
0
 /// <summary>
 /// Removes the installed game mod matching the <see cref="ModsData.ModItem.GameId" /> and <see cref="ModsData.ModItem.Id" />
 /// </summary>
 /// <param name="categoryId"></param>
 /// <param name="modId"></param>
 public void RemoveInstalledGameMod(string categoryId, int modId)
 {
     _ = InstalledGameMods.RemoveAll(x => string.Equals(x.CategoryId, categoryId, StringComparison.OrdinalIgnoreCase) && x.ModId.Equals(modId));
 }