src/GenFx/GeneticComponent.cs
/// <summary>
/// Validates the state of the configuration.
/// </summary>
Validates the state of the configuration.
Validates the state of the configuration .
public void Validate()
        {
            IEnumerable<PropertyInfo> properties = this.GetType()
                .GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy)
                .Where(p => p.GetIndexParameters().Length == 0);
            foreach (PropertyInfo propertyInfo in properties)
            {
                object propValue = propertyInfo.GetValue(this, null);
                this.ValidateProperty(propValue, propertyInfo);
            }
            ComponentValidatorAttribute[] attribs = (ComponentValidatorAttribute[])this.GetType().GetCustomAttributes(typeof(ComponentValidatorAttribute), true);
            foreach (ComponentValidatorAttribute attrib in attribs)
            {
                attrib.Validator.EnsureIsValid(this);
            }
        }
public void Validate ( ) { IEnumerable < PropertyInfo > properties = this . GetType ( ) . GetProperties ( BindingFlags . Public | BindingFlags . Instance | BindingFlags . FlattenHierarchy ) . Where ( p => p . GetIndexParameters ( ) . Length == 0 ) ; foreach ( PropertyInfo propertyInfo in properties ) { object propValue = propertyInfo . GetValue ( this , null ) ; this . ValidateProperty ( propValue , propertyInfo ) ; } ComponentValidatorAttribute [ ] attribs = ( ComponentValidatorAttribute [ ] ) this . GetType ( ) . GetCustomAttributes ( typeof ( ComponentValidatorAttribute ) , true ) ; foreach ( ComponentValidatorAttribute attrib in attribs ) { attrib . Validator . EnsureIsValid ( this ) ; } }
Validates the state of the configuration.
Validates the state of the configuration .
// Check that the property is valid using the validators attached directly to the property.