src/System.Management.Automation/engine/SessionStateCapacityVariable.cs
/// <summary>
/// Overrides the base IsValidValue to ensure the value is an int.
/// </summary>
/// 
/// <param name="value">
/// The value to test.
/// </param>
/// 
/// <returns>
/// true if the value is an int and the base class IsValidValue is true, otherwise
/// false.
/// </returns>
/// 
/// <exception cref="ValidationMetadataException">
/// If the validation metadata throws an exception.
/// </exception>
/// 
Overrides the base IsValidValue to ensure the value is an int.
Overrides the base IsValidValue to ensure the value is an int .
public override bool IsValidValue(object value)
        {
            int capacity = (int)value;
            if (capacity >= _minCapacity && capacity <= _maxCapacity)
                return true;
            else
                return base.IsValidValue(value);
        }
public override bool IsValidValue ( object value ) { int capacity = ( int ) value ; if ( capacity >= _minCapacity && capacity <= _maxCapacity ) return true ; else return base . IsValidValue ( value ) ; }
Overrides the base IsValidValue to ensure the value is an int.
Overrides the base IsValidValue to ensure the value is an int .
// If the value is within the limits, then return true // otherwise call the base validator so we'll get the error // from the validation attribute...
true if the value is an int and the base class IsValidValue is true, otherwise
false.
true if the value is an int and the base class IsValidValue is true otherwise false .
If the validation metadata throws an exception.
If the validation metadata throws an exception .
value
object
The value to test.
The value to test .