src/GenFx/GeneticAlgorithm.cs
/// <summary>
/// Compiles the mapping of component configuration properties to <see cref="PropertyValidator"/> objects as described by the specified component.
/// </summary>
/// <param name="component">The component to check whether it has defined validators for a configuration property.</param>
Compiles the mapping of component configuration properties to  objects as described by the specified component.
Compiles the mapping of component configuration properties to objects as described by the specified component .
private void CompileExternalValidatorMapping(GeneticComponent component)
        {
            if (component == null)
            {
                return;
            }
            IExternalConfigurationPropertyValidatorAttribute[] attribs = (IExternalConfigurationPropertyValidatorAttribute[])component.GetType().GetCustomAttributes(typeof(IExternalConfigurationPropertyValidatorAttribute), true);
            foreach (IExternalConfigurationPropertyValidatorAttribute attrib in attribs)
            {
                PropertyInfo prop = ExternalValidatorAttributeHelper.GetTargetPropertyInfo(attrib.TargetComponentType, attrib.TargetPropertyName);
                if (!this.externalValidationMapping.TryGetValue(prop, out List<PropertyValidator> validators))
                {
                    validators = new List<PropertyValidator>();
                    this.externalValidationMapping.Add(prop, validators);
                }
                validators.Add(attrib.Validator);
            }
        }
private void CompileExternalValidatorMapping ( GeneticComponent component ) { if ( component == null ) { return ; } IExternalConfigurationPropertyValidatorAttribute [ ] attribs = ( IExternalConfigurationPropertyValidatorAttribute [ ] ) component . GetType ( ) . GetCustomAttributes ( typeof ( IExternalConfigurationPropertyValidatorAttribute ) , true ) ; foreach ( IExternalConfigurationPropertyValidatorAttribute attrib in attribs ) { PropertyInfo prop = ExternalValidatorAttributeHelper . GetTargetPropertyInfo ( attrib . TargetComponentType , attrib . TargetPropertyName ) ; if ( ! this . externalValidationMapping . TryGetValue ( prop , out List < PropertyValidator > validators ) ) { validators = new List < PropertyValidator > ( ) ; this . externalValidationMapping . Add ( prop , validators ) ; } validators . Add ( attrib . Validator ) ; } }
Compiles the mapping of component configuration properties to  objects as described by the specified component.
Compiles the mapping of component configuration properties to objects as described by the specified component .
component
GeneticComponent
The component to check whether it has defined validators for a configuration property.
The component to check whether it has defined validators for a configuration property .