2 using System.Collections.Generic;
3 using System.ComponentModel;
5 namespace Tizen.NUI.Binding
7 [EditorBrowsable(EditorBrowsableState.Never)]
8 internal static class EnumerableExtensions
10 public static IEnumerable<T> GetGesturesFor<T>(this IEnumerable<IGestureRecognizer> gestures, Func<T, bool> predicate = null) where T : GestureRecognizer
15 if (predicate == null)
16 predicate = x => true;
18 foreach (IGestureRecognizer item in gestures)
20 var gesture = item as T;
21 if (gesture != null && predicate(gesture))
28 internal static IEnumerable<T> Append<T>(this IEnumerable<T> enumerable, T item)
30 foreach (T x in enumerable)
36 public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
38 foreach (T item in enumeration)
44 public static int IndexOf<T>(this IEnumerable<T> enumerable, T item)
46 if (enumerable == null)
47 throw new ArgumentNullException("enumerable");
50 foreach (T element in enumerable)
52 if (Equals(element, item))
61 public static int IndexOf<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate)
64 foreach (T element in enumerable)
66 if (predicate(element))
75 public static IEnumerable<T> Prepend<T>(this IEnumerable<T> enumerable, T item)
79 foreach (T x in enumerable)