Example #1
0
 internal static void CheckIntegerNotNegative(int value, string parameterName)
 {
     if (value < 0)
     {
         throw new ArgumentOutOfRangeException(parameterName, Strings.ExceptionUtils_CheckIntegerNotNegative(value));
     }
 }
Example #2
0
        /// <summary>
        /// Checks the <paramref name="value"/> for not being negative and throws <see cref="ArgumentOutOfRangeException"/> if it is negative.
        /// </summary>
        /// <param name="value">Argument whose value needs to be checked.</param>
        /// <param name="parameterName">Name of the argument, used for exception message.</param>
        internal static void CheckIntegerNotNegative(int value, string parameterName)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(!string.IsNullOrEmpty(parameterName), "!string.IsNullOrEmpty(parameterName)");

            if (value < 0)
            {
                throw new ArgumentOutOfRangeException(parameterName, Strings.ExceptionUtils_CheckIntegerNotNegative(value));
            }
        }