1
0

IObserver.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. #if NO_RXINTERFACES
  3. namespace System
  4. {
  5. /// <summary>
  6. /// Supports push-style iteration over an observable sequence.
  7. /// </summary>
  8. #if !NO_VARIANCE
  9. public interface IObserver<in T>
  10. #else
  11. public interface IObserver<T>
  12. #endif
  13. {
  14. /// <summary>
  15. /// Notifies the observer of a new element in the sequence.
  16. /// </summary>
  17. /// <param name="value">Next element in the sequence.</param>
  18. void OnNext(T value);
  19. /// <summary>
  20. /// Notifies the observer that an exception has occurred.
  21. /// </summary>
  22. /// <param name="error">The error that has occurred.</param>
  23. void OnError(Exception error);
  24. /// <summary>
  25. /// Notifies the observer of the end of the sequence.
  26. /// </summary>
  27. void OnCompleted();
  28. }
  29. }
  30. #elif !WINDOWSPHONE7 // TypeForwardedTo is not presen on windows phone 7 so we can't really target
  31. [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IObserver<>))]
  32. #endif