Ordinal Parameters

Ordinal parameters can be defined at the command line without a parameter name switch.


The following command class will be used to demonstrate the ordinal parameter feature.

    class TestCommand : InputCommand
        public string ParameterOne { get; set; }

        public string ParameterTwo { get; set; }

        public string ParameterThree { get; set; }

        public override void Invoke(CommandInvocationContext context)
            // do something

This command may be invoked by defining the parameter name switch and value for each parameter.

Test -parameterOne value1 -parameterTwo "this is another value" -parameterThree value3

The command can also be invoked to take advantage of the ordinal parameter feature

Test value1 value3 -parameterTwo value2

Test -parameterTwo value2 value1 value3

Test -value1 -parameterTwo value2 value3

see also Parameter Attribute

Last edited Apr 13, 2013 at 7:00 PM by jeffhewitt, version 3


No comments yet.