ThrowArgumentOutOfRangeException() публичный статический Метод

public static ThrowArgumentOutOfRangeException ( string paramName, string message ) : void
paramName string
message string
Результат void
Пример #1
0
 /// <summary>
 /// Determines whether the specified parameter is greater than zero.
 /// </summary>
 /// <param name="param">The parameter.</param>
 /// <param name="paramName">The name of the parameter.</param>
 /// <exception cref="ArgumentOutOfRangeException">The parameter is less than or equal to zero.</exception>
 public static void IsPositive(int param, string paramName)
 {
     if (param <= 0)
     {
         ExceptionUtil.ThrowArgumentOutOfRangeException(paramName, Resources.ParameterMustBePositive);
     }
 }
Пример #2
0
        /// <summary>
        /// Sets the encoder lossy quality.
        /// </summary>
        /// <param name="quality">The quality.</param>
        /// <exception cref="ArgumentOutOfRangeException">The quality parameter is not in the range of [0, 100] inclusive.</exception>
        /// <exception cref="HeifException">A LibHeif error occurred.</exception>
        /// <exception cref="ObjectDisposedException">The object has been disposed.</exception>
        public void SetLossyQuality(int quality)
        {
            if (quality < 0 || quality > 100)
            {
                ExceptionUtil.ThrowArgumentOutOfRangeException(nameof(quality), "Must be in the range of [0, 100].");
            }

            VerifyNotDisposed();

            var error = LibHeifNative.heif_encoder_set_lossy_quality(this.encoder, quality);

            error.ThrowIfError();
        }