src/Misc/Migrate/CmdLine/CommandLineParameterAttribute.cs
// <summary>
// Searches a type for all properties with the CommandLineParameterAttribute and does action
// </summary>
// <param name="argumentType"> The argument type </param>
// <param name="action"> The action to apply </param>
Searches a type for all properties with the CommandLineParameterAttribute and does action
Searches a type for all properties with the CommandLineParameterAttribute and does action
internal static void ForEach(
            Type argumentType, Func<PropertyInfo, IEnumerable<CommandLineParameterAttribute>> selector,
            Action<CommandLineParameter> action)
        {
            foreach (var parameter in argumentType.GetProperties().SelectMany(
                property => selector(property).Select(cmdAttribute => new CommandLineParameter(property, cmdAttribute)))
                )
            {
                action(parameter);
            }
        }
internal static void ForEach ( Type argumentType , Func < PropertyInfo , IEnumerable < CommandLineParameterAttribute > > selector , Action < CommandLineParameter > action ) { foreach ( var parameter in argumentType . GetProperties ( ) . SelectMany ( property => selector ( property ) . Select ( cmdAttribute => new CommandLineParameter ( property , cmdAttribute ) ) ) ) { action ( parameter ) ; } }
Searches a type for all properties with the CommandLineParameterAttribute and does action
Searches a type for all properties with the CommandLineParameterAttribute and does action
argumentType
Type
The argument type
The argument type
selector
Func<PropertyInfo, IEnumerable<CommandLineParameterAttribute>>
action
Action<CommandLineParameter>
The action to apply
The action to apply