tags:

views:

23

answers:

0

In the ConsoleFx library there is a StringValidatorAttribute.
This attribute has two constructors

  • One without any parameters
  • One with an "index" parameter

Furthermore it has two Properties:

  • Index
  • MinLength
  • MaxLength

I want to define the StringValidatorAttribute for the first argument in row to be exactly 3 characters. So I imagine it should be index 1, MinLength = MaxLength = 3.

Intellisence shows me the following options

  • ([int Index], [int MinLength], [int MaxLength])
  • (int index, [int Index], [int MinLength], [int MaxLength])

What I'm deducing is that each of them corresponds to a constructor and the bracketted ones denonte a Property.

How can i set Properties on an Attribute?

Update
Found it:

[StringValidator(MinLength = 3, MaxLength=3, Index= 1)]