Constants.cs 2.3 KB

123456789101112131415161718192021222324252627
  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. namespace System.Reactive
  5. {
  6. // We can't make those based on the Strings_Core.resx file, because the ObsoleteAttribute needs a compile-time constant.
  7. internal static class Constants_Core
  8. {
  9. private const string ObsoleteRefactoring = "This property is no longer supported due to refactoring of the API surface and elimination of platform-specific dependencies.";
  10. public const string ObsoleteSchedulerNewthread = ObsoleteRefactoring + " Please use NewThreadScheduler.Default to obtain an instance of this scheduler type.";
  11. public const string ObsoleteSchedulerTaskpool = ObsoleteRefactoring + " Please use TaskPoolScheduler.Default to obtain an instance of this scheduler type.";
  12. public const string ObsoleteSchedulerThreadpool = ObsoleteRefactoring + " Consider using Scheduler.Default to obtain the platform's most appropriate pool-based scheduler. In order to access a specific pool-based scheduler, please add a reference to the System.Reactive.PlatformServices assembly for your target platform and use the appropriate scheduler in the System.Reactive.Concurrency namespace.";
  13. public const string ObsoleteSchedulerequired = "This instance property is no longer supported. Use CurrentThreadScheduler.IsScheduleRequired instead.";
  14. }
  15. // We can't make those based on the Strings_*.resx file, because the ObsoleteAttribute needs a compile-time constant.
  16. internal static class Constants_Linq
  17. {
  18. public const string UseAsync = "This blocking operation is no longer supported. Instead, use the async version in combination with C# and Visual Basic async/await support. In case you need a blocking operation, use Wait or convert the resulting observable sequence to a Task object and block.";
  19. public const string UseTaskFromAsyncPattern = "This conversion is no longer supported. Replace use of the Begin/End asynchronous method pair with a new Task-based async method, and convert the result using ToObservable. If no Task-based async method is available, use Task.Factory.FromAsync to obtain a Task object.";
  20. }
  21. }