/// <summary> /// Adds the specified data to the mapping /// </summary> /// <param name="key">The key.</param> /// <param name="list">The list.</param> public void Add(object key, params int[] list) { list ??= Array.Empty <int>(); KeyToTagMapping.Replace(key, list); for (int i = 0; i < list.Length; i++) { TagToKeyMapping.Add(list[i], key); } }
/// <summary> /// Removes the specified key. /// </summary> /// <param name="key">The key.</param> /// <returns>True if it is removed, false otherwise</returns> public bool Remove(object key) { if (!KeyToTagMapping.TryGetValue(key, out var List)) { return(false); } for (int i = 0; i < List.Length; i++) { TagToKeyMapping.Remove(List[i], key); } KeyToTagMapping.Remove(key); return(true); }