locked
How does one set a default value? RRS feed

  • Question

  • I there an example of setting a defalult value for a string or boolean Argument?
    Do I have to write a ValueProvider?
    Thanks,

    Jay
    Thursday, April 13, 2006 2:45 PM

Answers

  • I believe the default GAT solution template comes with an example of this. Basically you just use the library-provided ExpressionEvaluatorValueProvider and set the Expression to your default value.

    Note that you're not limited to string default values, as the associated converter for the argument will perform necessary conversion if appropriate. For example, the expression can be "True" and it will be converted to a boolean automatically if the argument is System.Boolean.

    HTH
    Thursday, April 13, 2006 3:36 PM
    Moderator

All replies

  • I believe the default GAT solution template comes with an example of this. Basically you just use the library-provided ExpressionEvaluatorValueProvider and set the Expression to your default value.

    Note that you're not limited to string default values, as the associated converter for the argument will perform necessary conversion if appropriate. For example, the expression can be "True" and it will be converted to a boolean automatically if the argument is System.Boolean.

    HTH
    Thursday, April 13, 2006 3:36 PM
    Moderator
  • Thanks, here's the example for others looking.

    <Argument Name="Iterations" Type="System.Int32">
       <!-- Shows how to use the expression evaluator to assign simple default values, which are typed nevertheless -->
        <!-- The full type of the evaluator is included using XInclude from a reusable file -->
         <ValueProvider Type="Evaluator" Expression="5" />
    </Argument>


    Tuesday, May 16, 2006 10:34 PM