/// <summary> /// Adds all mods from <see cref="Donkey.cargo" into current modlist/> /// </summary> private void FillModList() { Modlist.Items.Clear(); Modlist.ItemCheck -= Modlist_ItemCheck; foreach (var mod in Donkey.cargo) { Modlist.Items.Add(mod); Modlist.SetItemChecked(Modlist.Items.Count - 1, mod.Enabled); } Modlist.ItemCheck += Modlist_ItemCheck; }
/// <summary> /// Applies search mask to visible modlist; depending on selected search mode, names and/or tags will be accounted for. /// </summary> /// <param name="mask">Mask contents.</param> private void ApplyMaskToModlist(string mask) { Modlist.Items.Clear(); Modlist.ItemCheck -= Modlist_ItemCheck; foreach (var mod in Donkey.cargo) { if (ModSelectedByMask(mask, mod)) { Modlist.Items.Add(mod); Modlist.SetItemChecked(Modlist.Items.Count - 1, mod.Enabled); } } Modlist.ItemCheck += Modlist_ItemCheck; }