Program.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. using System;
  5. using System.Linq;
  6. using System.Reactive.Linq;
  7. using System.Reflection;
  8. namespace ApiCompare
  9. {
  10. internal class Program
  11. {
  12. private static void Main()
  13. {
  14. var observable = typeof(Observable).GetMethods(BindingFlags.Public | BindingFlags.Static).Select(m => m.Name).Distinct();
  15. var asyncObservable = typeof(AsyncObservable).GetMethods(BindingFlags.Public | BindingFlags.Static).Select(m => m.Name).Distinct();
  16. var exclude = new[]
  17. {
  18. "AsObservable", // Trivially renamed to AsAsyncObservable.
  19. "ToObservable", // Trivially renamed to ToAsyncObservable.
  20. "Subscribe", // Trivially renamed to SubscribeAsync.
  21. "Collect", // Postponing push-to-pull adapters.
  22. "Chunkify", // Postponing push-to-pull adapters.
  23. "GetEnumerator", // Postponing push-to-pull adapters.
  24. "Latest", // Postponing push-to-pull adapters.
  25. "MostRecent", // Postponing push-to-pull adapters.
  26. "Next", // Postponing push-to-pull adapters.
  27. "ToEnumerable", // Postponing push-to-pull adapters.
  28. "ForEach", // Deprecating blocking functionality.
  29. "Wait", // Deprecating blocking functionality.
  30. };
  31. var missing = observable.Except(exclude).Except(asyncObservable).OrderBy(m => m);
  32. foreach (var m in missing)
  33. {
  34. Console.WriteLine(m);
  35. }
  36. Console.WriteLine();
  37. Console.WriteLine("Count = " + missing.Count());
  38. }
  39. }
  40. }