src/GenFx/GeneticComponent.cs
/// <summary>
/// Verifies that the value is a valid value for the property.
/// </summary>
/// <param name="value">Value being set to the property.</param>
/// <param name="propertyName">Name of the property being set.</param>
/// <exception cref="ArgumentException"><paramref name="propertyName"/> is null or empty.</exception>
/// <exception cref="ArgumentException">Property not found on configuration type.</exception>
/// <exception cref="ValidationException">Property was set to an invalid value.</exception>
Verifies that the value is a valid value for the property.
Verifies that the value is a valid value for the property .
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
        protected void ValidateProperty(object? value, [CallerMemberName] string propertyName = "")
        {
            if (String.IsNullOrEmpty(propertyName))
            {
                throw new ArgumentException(Resources.ErrorMsg_StringNullOrEmpty, nameof(propertyName));
            }
            PropertyInfo propertyInfo = this.GetType().GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy);
            if (propertyInfo == null)
            {
                throw new ArgumentException(StringUtil.GetFormattedString(
                  Resources.ErrorMsg_ComponentConfigurationPropertyNotFound, propertyName, this.GetType().FullName));
            }
            this.ValidateProperty(value, propertyInfo);
        }
[ System . Diagnostics . CodeAnalysis . SuppressMessage ( " " , " " ) ] protected void ValidateProperty ( object ? value , [ CallerMemberName ] string propertyName = " " ) { if ( String . IsNullOrEmpty ( propertyName ) ) { throw new ArgumentException ( Resources . ErrorMsg_StringNullOrEmpty , nameof ( propertyName ) ) ; } PropertyInfo propertyInfo = this . GetType ( ) . GetProperty ( propertyName , BindingFlags . Instance | BindingFlags . Public | BindingFlags . FlattenHierarchy ) ; if ( propertyInfo == null ) { throw new ArgumentException ( StringUtil . GetFormattedString ( Resources . ErrorMsg_ComponentConfigurationPropertyNotFound , propertyName , this . GetType ( ) . FullName ) ) ; } this . ValidateProperty ( value , propertyInfo ) ; }
Verifies that the value is a valid value for the property.
Verifies that the value is a valid value for the property .
None
Property not found on configuration type.
Property not found on configuration type .
Property was set to an invalid value.
Property was set to an invalid value .
value
object?
Value being set to the property.
Value being set to the property .
string
[CallerMemberName]
propertyName
Name of the property being set.
Name of the property being set .