コード例 #1
0
        public static void ThrowArgumentNull <T>(this ArgBase <T> arg)
        {
            if (string.IsNullOrEmpty(arg.Name))
            {
                throw new ArgumentNullException();
            }

            throw new ArgumentNullException(arg.Name);
        }
コード例 #2
0
        public static void ThrowArgument <T>(this ArgBase <T> arg, string message)
        {
            if (string.IsNullOrEmpty(arg.Name))
            {
                throw new ArgumentException(message);
            }

            throw new ArgumentException(message, arg.Name);
        }
コード例 #3
0
 public static void ThrowNotEqual <T>(this ArgBase <T> arg, T expected)
 {
     throw new NotExpectedException <T>(arg.Value, expected, arg.Name);
 }
コード例 #4
0
 public static void ThrowArgumentOutRange <T>(this ArgBase <T> arg, T min, T max)
 {
     throw new OutOfRangeException <T>(arg.Value, min, max, arg.Name);
 }
コード例 #5
0
 public static void ThrowLessThenExpected <T>(this ArgBase <T> arg, T min)
 {
     throw new LessThenExpectedException <T>(arg.Value, min, arg.Name);
 }
コード例 #6
0
 public static void ThrowPositiveValueExpected <T>(this ArgBase <T> arg)
 {
     throw new PositiveValueExpectedException <T>(arg.Value, arg.Name);
 }
コード例 #7
0
 public static void ThrowGreaterThenExpected <T>(this ArgBase <T> arg, T max)
 {
     throw new GreaterThenExpectedException <T>(arg.Value, max, arg.Name);
 }