private void AddCallback(DataCaptureCallback callback) { var map = callback.Attribute.IsOutgoing ? outDataCaptures : inDataCaptures; var list = map.GetOrAdd(callback.Header, CallbackListFactory); lock (list) list.Add(callback); }
private void RemoveCallback(DataCaptureCallback callback) { var map = callback.Attribute.IsOutgoing ? outDataCaptures : inDataCaptures; if (map.TryGetValue(callback.Header, out var callbacks)) { lock (callbacks) callbacks.Remove(callback); } }