Error.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. namespace System.Linq
  3. {
  4. static class Error
  5. {
  6. public static ArgumentNullException ArgumentNull (string parameter)
  7. {
  8. return new ArgumentNullException (parameter);
  9. }
  10. public static ArgumentOutOfRangeException ArgumentOutOfRange (string parameter)
  11. {
  12. return new ArgumentOutOfRangeException (parameter);
  13. }
  14. public static ArgumentException ArgumentNotValid (string parameter)
  15. {
  16. return new ArgumentException (parameter);
  17. }
  18. public static NotSupportedException NotSupported ()
  19. {
  20. return new NotSupportedException ();
  21. }
  22. public static InvalidOperationException NoElements ()
  23. {
  24. return new InvalidOperationException (Strings.NoElements);
  25. }
  26. public static InvalidOperationException NoMatch ()
  27. {
  28. return new InvalidOperationException (Strings.NoMatch);
  29. }
  30. public static InvalidOperationException MoreThanOneElement ()
  31. {
  32. return new InvalidOperationException (Strings.MoreThanOneElement);
  33. }
  34. public static InvalidOperationException MoreThanOneMatch ()
  35. {
  36. return new InvalidOperationException (Strings.MoreThanOneMatch);
  37. }
  38. public static ArgumentException ArgumentNotIEnumerableGeneric (object message)
  39. {
  40. return new ArgumentException (String.Format ("{0} is not IEnumerable<>", message));
  41. }
  42. public static InvalidOperationException NoMethodOnTypeMatchingArguments (object p0, object p1)
  43. {
  44. return new InvalidOperationException (Strings.NoMethodOnTypeMatchingArguments (p0, p1));
  45. }
  46. public static InvalidOperationException NoMethodOnType (object p0, object p1)
  47. {
  48. return new InvalidOperationException (Strings.NoMethodOnType (p0, p1));
  49. }
  50. }
  51. }