コード例 #1
0
        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);
        }
コード例 #2
0
 public void Buffer <T>(IBufferableEvent <T> sender, T args)
 => sender.Invoke(args);