2014-07-29 20:35:59 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2014-08-12 13:33:13 +00:00
|
|
|
|
namespace RainmeterStudio.Core.Utils
|
2014-07-29 20:35:59 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Linq extensions
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class LinqExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Applies action on every item from the container
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T">Enumerable type</typeparam>
|
|
|
|
|
/// <param name="container">Container</param>
|
|
|
|
|
/// <param name="action">Action</param>
|
|
|
|
|
public static void ForEach<T> (this IEnumerable<T> container, Action<T> action)
|
|
|
|
|
{
|
|
|
|
|
foreach (var obj in container)
|
|
|
|
|
action(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|