Error.cs 897 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace LitMotion
  4. {
  5. internal static class Error
  6. {
  7. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  8. public static void IsNull<T>(T target)
  9. {
  10. if (target == null) throw new ArgumentNullException(nameof(target));
  11. }
  12. public static void Format()
  13. {
  14. throw new FormatException("Input string was not in a correct format.");
  15. }
  16. public static void Argument(string message)
  17. {
  18. throw new ArgumentException(message);
  19. }
  20. public static void ArgumentNull(string message)
  21. {
  22. throw new ArgumentNullException(message);
  23. }
  24. public static void PlaybackSpeedMustBeZeroOrGreater()
  25. {
  26. throw new ArgumentOutOfRangeException("Playback speed must be 0 or greater.");
  27. }
  28. }
  29. }