EventPatternSource.cs 987 B

12345678910111213141516171819202122232425262728293031
  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. #if HAS_WINRT
  5. using Windows.Foundation;
  6. namespace System.Reactive
  7. {
  8. class EventPatternSource<TSender, TEventArgs> : EventPatternSourceBase<TSender, TEventArgs>, IEventPatternSource<TSender, TEventArgs>
  9. {
  10. public EventPatternSource(IObservable<EventPattern<TSender, TEventArgs>> source, Action<Action<TSender, TEventArgs>, /*object,*/ EventPattern<TSender, TEventArgs>> invokeHandler)
  11. : base(source, invokeHandler)
  12. {
  13. }
  14. event TypedEventHandler<TSender, TEventArgs> IEventPatternSource<TSender, TEventArgs>.OnNext
  15. {
  16. add
  17. {
  18. Add(value, (o, e) => value(o, e));
  19. }
  20. remove
  21. {
  22. Remove(value);
  23. }
  24. }
  25. }
  26. }
  27. #endif