ToolBelt.CommandLineParser.LazyGenerateCommandArguments C# (CSharp) Method

LazyGenerateCommandArguments() private method

private LazyGenerateCommandArguments ( ) : void
return void
        private void LazyGenerateCommandArguments()
        {
            if (commandArguments == null)
            {
                object[] attributes = this.argTargetType.GetCustomAttributes(typeof(CommandLineCommandDescriptionAttribute), true);
                commandArguments = new Dictionary<string, string[]>(attributes.Length);

                // Build a list of all the commands
                foreach (CommandLineCommandDescriptionAttribute attribute in attributes)
                {
                    string[] switches = attribute.Switches != null ? attribute.Switches.Split(',') : new string[0];
                    commandArguments.Add(attribute.Command, switches);
                }
            }
        }