Linq.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. extern alias SystemReactiveNet;
  5. using SystemReactiveNet::System.Reactive.Linq;
  6. using System.Runtime.CompilerServices;
  7. [assembly:TypeForwardedToAttribute(typeof(IGroupedObservable<,>))]
  8. [assembly:TypeForwardedToAttribute(typeof(IQbservable<>))]
  9. [assembly:TypeForwardedToAttribute(typeof(IQbservable))]
  10. [assembly:TypeForwardedToAttribute(typeof(IQbservableProvider))]
  11. [assembly:TypeForwardedToAttribute(typeof(LocalQueryMethodImplementationTypeAttribute))]
  12. [assembly:TypeForwardedToAttribute(typeof(Observable))]
  13. [assembly:TypeForwardedToAttribute(typeof(ObservableEx))]
  14. [assembly:TypeForwardedToAttribute(typeof(Qbservable))]
  15. [assembly:TypeForwardedToAttribute(typeof(QbservableEx))]
  16. [assembly:TypeForwardedToAttribute(typeof(QueryDebugger))]
  17. // These UI-framework-specific types have been moved to the platform-specific packages. To maintain binary
  18. // compatibility we forward the types to the new packages. However, when building reference assemblies for
  19. // the netX.0-windows10.0.X target, we do not include these types in the reference assembly. We do this to
  20. // enable applications that target a Windows-specific .NET TFM to use Rx without needing to reference the
  21. // Microsoft.WindowsDesktop.App framework. If we don't hide the UI-framework-specific types, they become
  22. // visible to the compiler, which can then complain that it can't find the Windows Forms or WPF types
  23. // that these types use. (In particular, this becomes a problem for the types that add UI-framework-specific
  24. // extension methods such as ObserveOn(Control). Code that is trying to use the non-UI-framework-specific
  25. // overloads fails to compile because the compiler can't find the Control type, and so it doesn't have
  26. // the information it requires to be determine that the Control overloads is not applicable.) So we
  27. // exclude UI-framework-specific types from the .NET '-windows' reference assembly, but we keep the
  28. // forwarders in the runtime assembly.
  29. #if !(BUILDING_REFERENCE_ASSEMBLY && NET8_0_OR_GREATER)
  30. #if WINDOWS
  31. [assembly:TypeForwardedToAttribute(typeof(System.Reactive.Linq.AsyncInfoObservable))]
  32. [assembly:TypeForwardedToAttribute(typeof(System.Reactive.Linq.CoreDispatcherObservable))]
  33. [assembly:TypeForwardedToAttribute(typeof(System.Reactive.Linq.WindowsObservable))]
  34. #endif
  35. #if HAS_WINFORMS
  36. [assembly:TypeForwardedToAttribute(typeof(System.Reactive.Linq.ControlObservable))]
  37. #endif
  38. #if HAS_DISPATCHER
  39. [assembly: TypeForwardedToAttribute(typeof(System.Reactive.Linq.DispatcherObservable))]
  40. #endif
  41. #endif