コード例 #1
0
        /// <summary>
        /// Parses Command Line Arguments.
        /// Use CommandLineArgumentAttributes to control parsing behaviour.
        /// </summary>
        /// <param name="arguments"> The actual arguments. </param>
        /// <param name="destination"> The resulting parsed arguments. </param>
        /// <param name="reporter"> The destination for parse errors. </param>
        public static void ParseCommandLineArguments(string[] arguments, object destination, ErrorReporter reporter)
        {
            CommandLineArgumentParser parser = new CommandLineArgumentParser(destination.GetType(), reporter);

            if (!parser.Parse(arguments, destination))
            {
                throw new Exception("Parsing failed");
            }
        }
コード例 #2
0
 /// <summary>
 /// Parses Command Line Arguments. 
 /// Use CommandLineArgumentAttributes to control parsing behaviour.
 /// </summary>
 /// <param name="arguments"> The actual arguments. </param>
 /// <param name="destination"> The resulting parsed arguments. </param>
 /// <param name="reporter"> The destination for parse errors. </param>
 public static void ParseCommandLineArguments(string[] arguments, object destination, ErrorReporter reporter)
 {
     CommandLineArgumentParser parser = new CommandLineArgumentParser(destination.GetType(), reporter);
     if (!parser.Parse(arguments, destination))
         throw new Exception("Parsing failed");
 }