public static List <Option> FindByDescriptor(OptionDescriptor descr, List <Option> options, int startIndex) { var foundOpts = new List <Option>(); for (int i = startIndex; i < options.Count; i++) { if (options[i].Descriptor == descr) { foundOpts.Add(options[i]); } } return(foundOpts); }
public static List <Option> FindByDescriptor(OptionDescriptor descr, List <Option> options) { return(FindByDescriptor(descr, options, 0)); }
public static Option FindFirstByDescriptor(OptionDescriptor descr, List <Option> options, int startIndex) { var foundOpt = FindByDescriptor(descr, options, startIndex); return(0 != foundOpt.Count ? foundOpt[0] : null); }