EventPatternSource.cs 968 B

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