Extension Methods from Daniel Gidman
Converts an Enumeration type into a dictionary of its names and values.
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.
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.
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.
Gets the index of the give value in a collection.
Is overloaded to take a start parameter as well.
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
Creates an explicit copy of the given enumerable where the only values copied are the ones you designate.
Finds all the indexes of the give value or values in an enumerable list