Exemplo n.º 1
0
        /// <summary>
        /// Initializes static members of the<see cref="GlobalParameters" /> class.
        /// </summary>
        static GlobalParameters()
        {
            // Unique parameters that can be used alone
            string[] uniqueParameters =
            {
                "-gui",
                "-help"
            };
            CommandLineArgumentParser.DefineUniqueParameters(uniqueParameters);

            // Mandatory parameters of the application decoded from the command line.
            string[] requiredArguments =
            {
                "-rx",
                "-tx",
            };

            CommandLineArgumentParser.DefineRequiredParameters(requiredArguments);

            // Optional parameters
            string[] optionalArguments =
            {
                "-baud=9600",
                "-parity=none",
                "-stopbit=1",
                "-data=8",
                "-output=stdout",
                "-bytesPerLine=16"
            };
            CommandLineArgumentParser.DefineOptionalParameter(optionalArguments);

            // Supported switches
            string[] switches =
            {
                "-onlyHex",
                "-onlyAscii",
                "-time",
                "-collapsed",
                "-ycable"
            };
            CommandLineArgumentParser.DefineSwitches(switches);
        }