public void Buffer <T>(IBufferableEvent <T> sender, T args) { if (!_buffering) { sender.Invoke(args); return; } TypedEventBuffer <T> buffer; if (_typedBuffers.TryGetValue(sender, out var tempBuffer)) { buffer = (TypedEventBuffer <T>)tempBuffer; } else { buffer = new TypedEventBuffer <T>(sender); _typedBuffers[sender] = buffer; } buffer.Buffer(args); }
public void Buffer <T>(IBufferableEvent <T> sender, T args) => sender.Invoke(args);