Ejemplo n.º 1
0
        private static IEnumerable <CommandData> CreateCommandOverloads(MethodInfo method, CommandAttribute commandAttribute, CommandDescriptionAttribute descriptionAttribute)
        {
            int defaultParameters = method.GetParameters().Count((ParameterInfo x) => x.HasDefaultValue);

            for (int i = 0; i < defaultParameters + 1; i++)
            {
                CommandData command = new CommandData(method, commandAttribute, descriptionAttribute, i);
                yield return(command);
            }
        }
Ejemplo n.º 2
0
 public CommandData(MethodInfo methodData, CommandAttribute commandAttribute, int defaultParameterCount = 0) : this(methodData, commandAttribute.Alias, defaultParameterCount)
 {
     CommandDescription = commandAttribute.Description;
     MonoTarget         = commandAttribute.MonoTarget;
 }