public bool Remove(IMediaSegment segment) { bool result; lock (((IDictionary)_segments).SyncRoot) result = _segments.Remove(((MediaSegment)segment).DtoGuid); if (result) { SegmentRemoved?.Invoke(this, new MediaSegmentEventArgs(segment)); NotifyPropertyChanged(nameof(Count)); } return(result); }
public bool Remove(IMediaSegment segment) { bool result = false; IMediaSegment removed; if (_segments.TryRemove(((MediaSegment)segment).DtoGuid, out removed)) { result = true; SegmentRemoved?.Invoke(this, new MediaSegmentEventArgs(removed)); NotifyPropertyChanged(nameof(Count)); } return(result); }