Project DescriptionAn ever-growing collection of extension methods I keep writing and losing.
Go ahead and grab the latest source; I don't think publishing binaries will be of value to anyone.
Array
- Remove<T>(this T[] array, Predicate<T> condition)
- Remove<T>(this T[] array, T item)
- T[] RemoveAt<T>(this T[] array, int index)
ICollection<T>
- bool ContainsAny<T>(this ICollection<T> collection, ICollection<T> toFind)
- bool ContainsAll<T>(this ICollection<T> collection, ICollection<T> toFind)
- K[] ToArray<T, K>(this ICollection<T> collection, Converter<T, K> converter)
ListView
- void AutoSort(this ListView listView)
- void AutoSort(this ListView listView, ListViewItemComparer comparer)
Dictionary<K,V>
- V GetOrCreate<K, V>(this Dictionary<K, V> dictionary, K key) where V : new()
- V GetOrLookUp<K, V>(this Dictionary<K, V> dictionary, K key, Func<K, V> lookup)
- void AddIfDoesNotExist<K, V>(this Dictionary<K, V> dictionary, K key, Func<K, V> lookup)
- V GetOrDefault<K, V>(this Dictionary<K, V> dictionary, K key)
ICollection
- T[] ToArray<T>(this ICollection collection)
IEnumerable
- T Find<T>(this IEnumerable collection, Predicate<T> condition)
- void ForEach<TCommon>(Action<TCommon> action, params IEnumerable[] collections)
- IEnumerable<T> AsEnumerable<T>(this IEnumerable collection)
IEnumerable<T>
- T Find<T>(this IEnumerable<T> collection, Predicate<T> condition)
- void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
IEnumerable<string>
- List<string> RemoveEmptyElements(this IEnumerable<string> strings)
IList<T>
- T First<T>(this IList<T> list)
- T Last<T>(this IList<T> list)
- void RemoveLast<T>(this IList<T> list)
Object
- TReturn As<TReturn, T1, T2>(this object o)
- TReturn As<TReturn, T1, T2, T3>(this object o)
- TReturn As<TReturn, T1, T2, T3, T4>(this object o)
- TReturn As<TReturn, T1, T2, T3, T4, T5>(this object o)
- bool Is<T1, T2>(this object o)
- bool Is<T1, T2, T3>(this object o)
- bool Is<T1, T2, T3, T4>(this object o)
- bool Is<T1, T2, T3, T4, T5>(this object o)
- T[] CreateArray<T>(this T obj)
StringBuilder
- void AppendIf(this StringBuilder sb, bool condition, char text)
- void AppendIf(this StringBuilder sb, bool condition, string text)
String
- string Default(this string s, string defaultValue)
- string Default(this string s, string defaultValue, bool onlyWhenNull)
- string Fmt(this string format, params object[] args)
Enum
- bool ContainsFlagValue(this Enum e, string flagValue)
- bool ContainsFlagValue(this Enum e, Enum flagValue)
TreeView
- T FindNode<T>(this TreeView treeView, Predicate<T> condition) where T : TreeNode
- TreeNode FindNode(this TreeView treeView, Predicate<TreeNode> condition)
- T FindNode<T>(this TreeNode treeNode, Predicate<T> condition) where T : TreeNode
- TreeNode FindNode(this TreeNode treeNode, Predicate<TreeNode> condition)
- List<T> FindNodes<T>(this TreeView treeView, Predicate<T> condition) where T : TreeNode
- List<TreeNode> FindNodes(this TreeView treeView, Predicate<TreeNode> condition)
- List<T> FindNodes<T>(this TreeNode treeNode, Predicate<T> condition) where T : TreeNode
- List<TreeNode> FindNodes(this TreeNode treeNode, Predicate<TreeNode> condition)
- List<T> GetDescendants<T>(this TreeView treeView) where T : TreeNode
- List<TreeNode> GetDescendants(this TreeView treeView)
- List<T> GetDescendants<T>(this TreeNode treeNode) where T : TreeNode
- List<TreeNode> GetDescendants(this TreeNode treeNode)