示例#1
0
        public bool TryRemove(TKey key, out TValue value)
        {
            if (Dictionary.TryRemove(key, out value))
            {
                if (Dictionary.IsEmpty)
                {
                    _emptyHandler?.Invoke(_emptyEventArgs);
                    return(true);
                }
            }

            return(false);
        }
 /// <summary>
 /// Gets called when there are no more subscriptions
 /// </summary>
 /// <param name="emptyEventArgs">A DeviceDescriptor describing the device</param>
 private void DeviceEmptyHandler(DeviceDescriptor emptyEventArgs)
 {
     _emptyHandler?.Invoke(emptyEventArgs);
 }