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 TypedEventBuffer(IBufferableEvent <T> sender)
 => _sender = sender;
Beispiel #3
0
 public void Buffer <T>(IBufferableEvent <T> sender, T args)
 => sender.Invoke(args);