private void CompileModList() { string[] ModsFolderContents = Directory.GetFiles(ModFolder); foreach (string s in ModsFolderContents) { var fi = new FileInfo(s); if (fi.Extension == ".dll" && !fi.Attributes.HasFlag(FileAttributes.ReparsePoint)) { targetFiles.Add(new ModRelay(s)); } if (AintThisPS(s)) { PubstuntFound = true; } } foreach (ModRelay mr in targetFiles) { Modlist.Items.Add(mr); } for (int i = 0; i < Modlist.Items.Count; i++) { if (Modlist.Items[i] is ModRelay) { ModRelay mr = Modlist.Items[i] as ModRelay; Modlist.SetItemCheckState(i, (mr.enabled) ? CheckState.Checked : CheckState.Unchecked); } } }
private void ApplyMaskToModlist(string mask) { bool oldrst = ReadyForRefresh; ReadyForRefresh = false; Modlist.Items.Clear(); foreach (ModRelay mr in targetFiles) { if (ModSelectedByMask(mask, mr)) { Modlist.Items.Add(mr); } } for (int i = 0; i < Modlist.Items.Count; i++) { if (Modlist.Items[i] is ModRelay) { ModRelay mr = Modlist.Items[i] as ModRelay; Modlist.SetItemCheckState(i, (mr.enabled) ? CheckState.Checked : CheckState.Unchecked); } } ReadyForRefresh = oldrst; }