public void AddSource(ISourceOfEvents source) { lock (SourceOfEventsGroupLock) { source.SomethingHappened1 += _SomethingHappened1; source.SomethingHappened2 += _SomethingHappened2; _SourceOfEventsGroup.Add(source); } }
public void RemoveSource(ISourceOfEvents source) { lock (SourceOfEventsGroupLock) { source.SomethingHappened1 -= _SomethingHappened1; source.SomethingHappened2 -= _SomethingHappened2; _SourceOfEventsGroup.Remove(source); } }