Example #1
0
        public GDTransferFile[] GetAvailableModSelection()
        {
            var mods = GlobalPaths.TransferFiles;

            foreach (var entry in _playerItemDao.GetModSelection())
            {
                if (!mods.Any(m => m.IsHardcore == entry.IsHardcore && m.Mod?.ToLower() == entry.Mod?.ToLower()))
                {
                    mods.Add(new GDTransferFile
                    {
                        Mod        = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(entry.Mod ?? string.Empty),
                        IsHardcore = entry.IsHardcore,
                        Enabled    = true
                    });
                }
            }

            if (mods.Count != _numAvailableModFiltersLastUpdate)
            {
                List <GDTransferFile> result = new List <GDTransferFile>();
                foreach (var item in mods)
                {
                    item.Enabled = true;
                    result.Add(item);
                }

                mods = result;
            }

            _numAvailableModFiltersLastUpdate = mods.Count;

            return(mods.ToArray());
        }
Example #2
0
 public IList <ModSelection> GetModSelection()
 {
     return(ThreadExecuter.Execute(
                () => repo.GetModSelection()
                ));
 }