static Dictionary <string, List <string> > GetDLClist() { // string testString = @"{ // ""Version"": 25, // ""Items"": [ // { // ""Name"": ""[COM3D2 Compatible Update Patch]"", // ""Files"": [""csv_old.arc""] // }, // ] // }"; string dlcListFilePath = SelectedGameCode == GameCode.CM3D2 ? CM_DLCListPath : COM_DLCListPath; try { DLCList dlcList = ReadDLCJSON(dlcListFilePath); // Validate DLC version with Apps bool isValid = CheckDLCListVersion(dlcList.AppMinVersion); if (!isValid) { throw new JSONInvalidVersionException(); } return(dlcList.Items.ToDictionary(keySelector: item => item.Name, item => item.Files)); } catch (JSONException) { throw; } catch { throw new JSONBadFormatException(); } }
public void FilterDLCs(DLCList DLCList) { var dlcTypes = ComboBoxDLCType.GetSelectedItem <DLCType>(); var words = TextFilterDLCs.Text?.Split(" "); DLCList.FilterItems(item => DLCPredicateFast(item, dlcTypes, words)); }
public void PopulateDLCs() { Log.Info("Populating DLCs"); dgDLCs.SuspendLayout(); try { dgDLCs.Rows.Clear(); DLCList = new DLCList(DLCManager.instance.DLCs, FilterDLCs); } catch (Exception ex) { Log.Exception(ex); } finally { dgDLCs.ResumeLayout(); DgDLCs_Refresh(); } }