Project Description
An evolving library of useful .Net v3.5 extension methods for the built-in CLR types, that simplify and accelerate .Net software development.

The aim of this project is to build a library of genuinely useful extension methods that actually save time and improve code comprehension and integrity. No fillers - Extension methods for the sake of extension methods are not included here, this is all about implementing truly useful functionality and reducing commonly repeated code.

First Release - v0.1.0.0

While the version number might indicate that this is beta code, it's really just a reflection that the library is far from complete. The extension methods featured here are in fact solid, and have been used in numerous commercial projects. The initial release of this library introduces the following extension methods:

DateTime Extenders
  • DateOnly - Returns the date only portion of a DateTime
  • FirstDayOfMonth - Returns the first day of the month for the specified date
  • FirstDayOfWeek - Returns the first day fo the week for the specified date
  • GetEndOfDay - Returns the date with the time set to 23:59.59.999 (useful for date range comparisons)
  • IsDateEqual - Compares the date-only portion of two DateTime instances
  • IsWeekday - Returns whether the specified DateTime falls on a weekday
  • IsWeekend - Returns whether the specified DateTime falls on a weekend
  • LastDayOfMonth - Returns the last day of the month for the specified date
  • LastDayOfWeek - Returns the last day of the week for the specified date
  • TimeOnly - Returns the time only portion of a DateTime
  • ToLongDate (overloaded) - Returns a long date string representation of the DateTime
  • ToLongTime (overloaded) - Returns a long time string represenation of the DateTime
  • ToShortDate (overloaded) - Returns a short date string representation of the DateTime
  • ToShortTime (overloaded) - Returns a short time string representation of the DateTime
  • WeekOfYear - Returns the ISO 8601 week of the year number for the DateTime

Decimal Extenders
  • RoundDecimalPoints - Rounds the supplied decimal to the specified amount of decimal points
  • RoundToTwoDecimalPoints - Rounds the supplied decimal value to two decimal points

Event Extenders
  • RaiseEvent - Raises an event of any type that implements the standard event signature (object sender, :EventArgs e) on the current thread
  • RaiseEventOnUIThread - Raises an event of any type that implements the standard event signature (object sender, :EventArgs e) on the event subscribers UI thread (if possible).

Object Extenders
  • CopyPropertiesFrom (overloaded) - Copies the readable and writable public property values from the source object to the target
  • DeepClone - Creates a deep clone of the specified object using XML serialization
  • ToPropertiesString (overloaded) - Returns a string representation of the objects property values (Awesome for debug logs!)
  • ToXml (overloaded) - Serializes the object into an XML string (see the ToObjectFromXml method in String Extenders for the inverse).

String Extenders
  • HtmlDecode - Decodes a HTML encoded string
  • HtmlEncode - Converts a string to a HTML encoded string
  • LimitCharacters - Limits a string to a pre-defined list of allowable characters
  • ParseQueryString (overloaded) - Parses a query string into a NameValueCollection
  • RemoveNonNumeric - Removes non-numeric characters from the input string
  • StripHtml - Removes all HTML markup tags from the supplied string
  • ToBool - Parses the string into a boolean value
  • ToShort - Parses the string into a short (Int16) value
  • ToInt - Parses the string into an int (Int32) value
  • ToLong - Parses the string into a long (Int64) value
  • ToDecimal - Parses the string into a decimal value
  • ToFloat - Parses the string into a float (Single) value
  • ToObjectFromXml (overloaded) - Deserializes an XML string into an object instance
  • ToStream (overloaded) - Converts a string into a Stream
  • ToByteArray (overloaded) - Converts a string into a byte array
  • ToTitleCase (overloaded) - Converts the supplied string to Title Case
  • UrlDecode (overloaded) - Converts a string that has been encoded for transmission in a URL into a decoded string
  • UrlEncode (overloaded) - URL encodes the specified string

Last edited Sep 27, 2008 at 11:02 AM by Componax, version 9