You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
745 B

4 years ago
4 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Apewer.Internals.QrCode
  4. {
  5. internal delegate TResult Func<in T, out TResult>(T arg);
  6. internal static class Methods
  7. {
  8. public static bool Contains<T>(IEnumerable<T> objects, T cell)
  9. {
  10. foreach (var i in objects)
  11. {
  12. if ((object)i == (object)cell) return true;
  13. }
  14. return false;
  15. }
  16. public static List<int> Select(IEnumerable<string> input, Func<string, int> selector)
  17. {
  18. var list = new List<int>();
  19. foreach (var oldValue in input)
  20. {
  21. list.Add(selector(oldValue));
  22. }
  23. return list;
  24. }
  25. }
  26. }