EventPatternSource.cs 890 B

12345678910111213141516171819202122232425262728
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. namespace System.Reactive
  3. {
  4. class EventPatternSource<TEventArgs> : EventPatternSourceBase<object, TEventArgs>, IEventPatternSource<TEventArgs>
  5. #if !NO_EVENTARGS_CONSTRAINT
  6. where TEventArgs : EventArgs
  7. #endif
  8. {
  9. public EventPatternSource(IObservable<EventPattern<object, TEventArgs>> source, Action<Action<object, TEventArgs>, /*object,*/ EventPattern<object, TEventArgs>> invokeHandler)
  10. : base(source, invokeHandler)
  11. {
  12. }
  13. event EventHandler<TEventArgs> IEventPatternSource<TEventArgs>.OnNext
  14. {
  15. add
  16. {
  17. Add(value, (o, e) => value(o, e));
  18. }
  19. remove
  20. {
  21. Remove(value);
  22. }
  23. }
  24. }
  25. }