fCraft.ColorKeyAttribute.Validate C# (CSharp) Method

Validate() public method

public Validate ( string value ) : void
value string
return void
        public override void Validate( string value )
        {
            base.Validate( value );
            string parsedValue = Color.Parse( value );
            if ( parsedValue == null ) {
                throw new FormatException( "Value cannot be parsed as a color." );
            } else if ( parsedValue.Length == 0 && NotBlank ) {
                throw new FormatException( "Value may not represent absence of color." );
            }
        }