EventPatternSource.cs 917 B

123456789101112131415161718192021222324252627
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Reactive
  5. {
  6. internal sealed class EventPatternSource<TEventArgs> : EventPatternSourceBaseInternal<object, TEventArgs>, IEventPatternSource<TEventArgs>
  7. {
  8. public EventPatternSource(IAsyncObservable<EventPattern<object, TEventArgs>> source, Action<Action<object, TEventArgs>, /*object,*/ EventPattern<object, TEventArgs>> invokeHandler)
  9. : base(source, invokeHandler)
  10. {
  11. }
  12. event EventHandler<TEventArgs> IEventPatternSource<TEventArgs>.OnNext
  13. {
  14. add
  15. {
  16. Add(value, (o, e) => value(o, e));
  17. }
  18. remove
  19. {
  20. Remove(value);
  21. }
  22. }
  23. }
  24. }