IEventPattern.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. /// <summary>
  7. /// Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event.
  8. /// </summary>
  9. /// <typeparam name="TSender">
  10. /// The type of the sender that raised the event.
  11. /// This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
  12. /// </typeparam>
  13. /// <typeparam name="TEventArgs">
  14. /// The type of the event data generated by the event.
  15. /// This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
  16. /// </typeparam>
  17. public interface IEventPattern<
  18. #if !NO_VARIANCE
  19. out TSender, out TEventArgs
  20. #else
  21. TSender, TEventArgs
  22. #endif
  23. >
  24. #if !NO_EVENTARGS_CONSTRAINT
  25. where TEventArgs : EventArgs
  26. #endif
  27. {
  28. /// <summary>
  29. /// Gets the sender object that raised the event.
  30. /// </summary>
  31. TSender Sender { get; }
  32. /// <summary>
  33. /// Gets the event data that was generated by the event.
  34. /// </summary>
  35. TEventArgs EventArgs { get; }
  36. }
  37. }