protected virtual bool RemoveMod(IMod mod) { var key = mod.GetSerializationString(); lock (Items) { lock (AdditionalMods) { if (!AdditionalMods.Contains(key, StringComparer.InvariantCultureIgnoreCase)) { return(false); } AdditionalMods.Remove(key); } if (Mods.Contains(key, StringComparer.InvariantCultureIgnoreCase)) { return(false); } Items.RemoveAll(Items.Where(x => x.ComparePK(mod)).ToArray()); DisabledItems.RemoveAllLocked(x => x.Equals(mod.Name, StringComparison.InvariantCultureIgnoreCase)); UpdateState(); return(true); } }
public void EnableMod(string name) { DisabledItems.RemoveAllLocked(x => x.Equals(name, StringComparison.CurrentCultureIgnoreCase)); UpdateState(); }