Esempio n. 1
0
        /// <summary>
        /// Parses RepeatResolver command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void RepeatResolver(string[] args)
        {
            LayoutRefinementArguments arguments = new LayoutRefinementArguments();
            CommandLineArguments      parser    = new CommandLineArguments();

            // Add parameters
            parser.Parameter(ArgumentType.DefaultArgument, "FilePath", ArgumentValueType.MultipleUniqueStrings, "", "File path");
            parser.Parameter(ArgumentType.Optional, "Help", ArgumentValueType.Bool, "h", "Print the help information.");
            parser.Parameter(ArgumentType.Optional, "OutputFile", ArgumentValueType.String, "o", "Output file");
            parser.Parameter(ArgumentType.Optional, "Verbose", ArgumentValueType.Bool, "v", "Display verbose logging during processing.");

            if (args.Length > 1)
            {
                try
                {
                    parser.Parse(args, arguments);
                }
                catch (ArgumentException ex)
                {
                    Output.WriteLine(OutputLevel.Error, ex.Message);
                    Output.WriteLine(OutputLevel.Required, Resources.LayoutRefinementUtilHelp);
                    return;
                }

                if (arguments.Help || arguments.FilePath.Length != 2)
                {
                    Output.WriteLine(OutputLevel.Required, Resources.LayoutRefinementUtilHelp);
                }
                else
                {
                    if (arguments.Verbose)
                    {
                        Output.TraceLevel = OutputLevel.Information | OutputLevel.Verbose;
                    }
                    else
                    {
                        Output.TraceLevel = OutputLevel.Information;
                    }

                    arguments.RefineLayout();
                }
            }
            else
            {
                Output.WriteLine(OutputLevel.Required, Resources.LayoutRefinementUtilHelp);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Parses RepeatResolver command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void RepeatResolver(string[] args)
        {
            LayoutRefinementArguments arguments = new LayoutRefinementArguments();

            if (args.Length > 1 && Parser.ParseArguments(args, arguments))
            {
                if (!string.IsNullOrEmpty(arguments.FilePath))
                {
                    arguments.RefineLayout();
                }
                else
                {
                    DisplayErrorMessage(Resources.LayoutRefinementUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.LayoutRefinementUtilHelp);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Parses RepeatResolver command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void RepeatResolver(string[] args)
        {
            LayoutRefinementArguments arguments = new LayoutRefinementArguments();
            CommandLineArguments      parser    = new CommandLineArguments();

            // Add parameters
            parser.Parameter(ArgumentType.DefaultArgument, "FilePath", ArgumentValueType.MultipleUniqueStrings, "", "File path");
            parser.Parameter(ArgumentType.Optional, "Help", ArgumentValueType.Bool, "h", "Print the help information.");
            parser.Parameter(ArgumentType.Optional, "OutputFile", ArgumentValueType.String, "o", "Output file");
            parser.Parameter(ArgumentType.Optional, "Verbose", ArgumentValueType.Bool, "v", "Display verbose logging during processing.");
            if (args.Length > 1)
            {
                try
                {
                    parser.Parse(args, arguments);
                }
                catch (ArgumentException ex)
                {
                    DisplayErrorMessage(ex.Message);
                    DisplayErrorMessage(Resources.LayoutRefinementUtilHelp);
                    Environment.Exit(-1);
                }

                if (arguments.Help)
                {
                    DisplayErrorMessage(Resources.LayoutRefinementUtilHelp);
                }
                else if (arguments.FilePath.Length == 2)
                {
                    arguments.RefineLayout();
                }
                else
                {
                    DisplayErrorMessage(Resources.LayoutRefinementUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.LayoutRefinementUtilHelp);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Parses RepeatResolver command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void RepeatResolver(string[] args)
        {
            LayoutRefinementArguments arguments = new LayoutRefinementArguments();
            CommandLineArguments parser = new CommandLineArguments();

            // Add parameters
            parser.Parameter(ArgumentType.DefaultArgument, "FilePath", ArgumentValueType.MultipleUniqueStrings, "", "File path");
            parser.Parameter(ArgumentType.Optional, "Help", ArgumentValueType.Bool, "h", "Print the help information.");
            parser.Parameter(ArgumentType.Optional, "OutputFile", ArgumentValueType.String, "o", "Output file");
            parser.Parameter(ArgumentType.Optional, "Verbose", ArgumentValueType.Bool, "v", "Display verbose logging during processing.");

            if (args.Length > 1)
            {
                try
                {
                    parser.Parse(args, arguments);
                }
                catch (ArgumentException ex)
                {
                    Output.WriteLine(OutputLevel.Error, ex.Message);
                    Output.WriteLine(OutputLevel.Required, Resources.LayoutRefinementUtilHelp);
                    return;
                }

                if (arguments.Help || arguments.FilePath.Length != 2)
                {
                    Output.WriteLine(OutputLevel.Required, Resources.LayoutRefinementUtilHelp);
                }
                else
                {
                    if (arguments.Verbose)
                        Output.TraceLevel = OutputLevel.Information | OutputLevel.Verbose;
                    else
                        Output.TraceLevel = OutputLevel.Information;

                    arguments.RefineLayout();
                }
            }
            else
            {
                Output.WriteLine(OutputLevel.Required, Resources.LayoutRefinementUtilHelp);
            }
        }