Extension Methods from Daniel Gidman
-
EnumToDictionary
Converts an Enumeration type into a dictionary of its names and values.
-
NotEmpty
Determines if the object is null or empty. string is evaluated with empty. Collections, Arrays and Dictionaries are evaluated for 0 items (items themselves may be null) All other objects are evaluated as null or not null.
-
Evaluate/Calculate
This is submitted as two extension methods as they work together. It is based off of an class designed by sfabriz @ http://www.osix.net/modules/article/?id=761 He has another class that does something a little different but I thought this was a wonderful piece of code so encapsulated it here. I only claim authorship of the conversion and not the underlying logic.
-
IndexOf
Gets the index of the give value in a collection. Is overloaded to take a start parameter as well.
-
Chain
Allows chaining together actions to be taken place on the fly. It works with any object. Its a simple concept but I couldn't find any examples that does the same.
-
SpinThread
Spins up and executes the action within a thread. Basically fire and forget. Real big question here. Does anybody see any issues with thread management? I would like to update this with any code necessary to manage thread cleanup if necessary. I realize that this has the ability to create unsafe thread referencing if not written such that the contents of the action are exclusive to the scope of the action, but that is outside the purview of this extension
-
CloneExplicit<T>
Creates an explicit copy of the given enumerable where the only values copied are the ones you designate.
-
IndicesOf
Finds all the indexes of the give value or values in an enumerable list