public static void RemoveKey <CompareWith>(this CassandraColumnFamily <CompareWith> family, BytesType key)
            where CompareWith : CassandraType
        {
            var op = new RemoveKey(key);

            family.ExecuteOperation(op);
        }
示例#2
0
        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");
            }
        }
        private void contextMenuItem_PreviewMouseUp(object sender, MouseButtonEventArgs e)
        {
            APIKeyEntity removingKey = keysList.SelectedItem as APIKeyEntity;

            RemoveKey?.Invoke(sender, removingKey.KeyValue);
        }