public static IEnumerable <T> Peek <T>(this IEnumerable <T> items, BiAction <T, int> action) { var enumerable = items.ToList(); for (var index = 0; index < enumerable.Count; index++) { var item = enumerable[index]; action.Invoke(item, index); } return(enumerable); }
public static List <List <double> > processingFilesInDirectory(String dirName, BiAction action, Color baseColor) { List <List <double> > res = new List <List <double> >(); String[] fileNames = Directory.GetFiles(dirName); foreach (String fnm in fileNames) { res.Add(action(fnm, baseColor)); } return(res); }