private string GetPipeSeparatedList(IEnumerable<Geocode> enumerable) { var buffer = new StringBuilder(); enumerable.For(x => { if (buffer.Length == 0) buffer.Append(x.ToString()); else buffer.Append(" | ").Append(x.ToString()); }); return buffer.ToString(); }
public void AddTags(IEnumerable<string> tags) { lock( _syncRoot ) { tags.For( x => { if( _currentTags.Contains(x) == false ) _currentTags.Add(x); }); } }
public void RemoveTags(IEnumerable<string> tags) { lock (_syncRoot) { tags.For(t => { _currentTags.Remove(t); }); } }
public static void For <T>(this IEnumerable <T> enumerable, Action <T> action) { enumerable.For(enumerable.Count(), action); }
// 引数取らないバージョン public static void For <T>(this IEnumerable <T> enu, Action act) { enu.For(act); }
/// <summary> /// 1行追加する。末尾に追加する。 /// /// [備考] /// CsvNamedLineを追加するAppendもあるので注意。 /// </summary> /// <param name="line"></param> public void Append(IEnumerable <string> line) { var y = Height; line.For((s, i) => Set(i, y, s)); }
public static IEnumerable <T> ForAndReturn <T>(this IEnumerable <T> enumerable, Action <IEnumerable <T>, int> action) { enumerable.For(action); return(enumerable); }