public void Remove(K _key, V _ValueToRemove) { List <V> tempValues; if (map.TryGetValue(_key, out tempValues)) { if (tempValues.Remove(_ValueToRemove)) { RemoveValue?.Invoke(_ValueToRemove); if (tempValues.Count == 0) { RemoveKey?.Invoke(_key); map.Remove(_key); } } else { Console.WriteLine("The value " + _ValueToRemove + " could not be found in association with " + _key); } } else { Console.WriteLine("The key " + _key + " could not be found"); } }
void RemoveKeyFromSession(RemoveValue message) { IncrementChangeCounter(); _storage.Remove(message.DocumentType.ToString(), message.Key); }
/// <summary> /// Extends Remove action with the ability to ignore case. /// </summary> public static RemoveValueIgnoringCase IgnoringCase(this RemoveValue source) { return(new RemoveValueIgnoringCase(source)); }
/// <summary> /// Extends Remove action with the ability to change starting point. /// </summary> /// <param name="position"> /// Position in source string to start from. Beginning or End values could be used /// </param> /// <exception cref="ArgumentOutOfRangeException">Thrown when StartOf or EndOf position value is used</exception> public static RemoveValueFrom From(this RemoveValue source, The position) { return(new RemoveValueFrom(source, position)); }
public static RemoveValueAfterOccurrence After(this RemoveValue source, int occurrence, string marker) { return(new RemoveValueAfterOccurrence(source, occurrence, marker)); }
public static RemoveValueAfter After(this RemoveValue source, string marker) { return(new RemoveValueAfter(source, marker)); }
public static RemoveValueBeforeOccurrence Before(this RemoveValue source, int occurrence, string marker) { return(new RemoveValueBeforeOccurrence(source, occurrence, marker)); }
public static RemoveValueBefore Before(this RemoveValue source, string marker) { return(new RemoveValueBefore(source, marker)); }