Craig's Utility Library 3.1

Rating: No reviews yet
Downloads: 2858
Change Set: 83485a4323a6
Released: Mar 23, 2012
Updated: Mar 23, 2012 by JaCraig
Dev status: Stable Help Icon

Recommended Download

application, 16502K, uploaded Mar 23, 2012 - 1716 downloads

Other Available Downloads

documentation, 6356K, uploaded Mar 23, 2012 - 480 downloads
example, 1352K, uploaded Mar 23, 2012 - 210 downloads
Application UtilitiesDLLsOnly
application, 1426K, uploaded Mar 23, 2012 - 141 downloads
application, 24505K, uploaded Mar 23, 2012 - 139 downloads
example, 3182K, uploaded Mar 23, 2012 - 172 downloads

Release Notes

This update adds about 60 new extension methods, a couple of new classes, and a number of fixes including:

  • Added DateSpan class
  • Added GenericDelimited class
  • Random additions
    • Added static thread friendly version of Random.Next called ThreadSafeNext.
  • AOP Manager additions
    • Added Destroy function to AOPManager (clears out all data so system can be recreated. Really only useful for testing...)
  • ORM additions
    • Added PagedCommand and PageCount functions to ObjectBaseClass (same as MicroORM).
    • In ORM added PagedCommand and PageCount functions (same as MicroORM).
    • Added Paged/PageCount functions to ObjectBaseClass.
    • Added PageCount function to ORM Session (forgot about it earlier until, of course, I needed it).
    • Added Setup function to ORM code to allow defining/setting up mappings (and derived types) at start instead of creating them on the fly.
    • Added Destroy function to ORM (clears out all data so system can be recreated. Really only useful for testing...)
  • MicroORM additions
    • Added ClearAllMappings function to MicroORM (clears out all mappings from the system, so it can be recreated. Really only useful for testing...)
  • Delimited file additions
    • Added Parse function, ToDataTable, and ToFile functions to base class
  • SQLHelper additions
    • Added ExecuteBulkCopy
  • Object Extensions
    • ThrowIfTrue
    • ThrowIfFalse
    • TryTo (converts the type, but still returns it as an object. Good for converting string to int, int to float, etc. but still need it as an object for whatever reason)
  • IEnumerable Extensions
    • FalseForAll
    • FalseForAny
    • TrueForAll
    • TrueForAny
    • ThrowIfFalseForAll
    • ThrowIfFalseForAny
    • ThrowIfTrueForAll
    • ThrowIfTrueForAny
    • ElementsBetween
    • First
    • Last
    • ToDataTable
    • ToCSV
    • ToDelimitedFile
  • string Extensions
    • ExpandTabs
    • StripLeft
    • StripRight
    • Pluralize
    • Singularize
    • Center
    • MaskLeft
    • MaskRight
    • UrlDecode
    • UrlEncode
  • FileInfo Extensions
    • DriveInfo
    • Execute
  • DirectoryInfo Extensions
    • DriveInfo
    • DeleteDirectoriesNewerThan
    • DeleteDirectoriesOlderThan
  • DateTime Extensions
    • FirstDayOfQuarter
    • FirstDayOfYear
    • LastDayOfQuarter
    • LastDayOfYear
    • ConvertToTimeZone (assumes that times are in UTC time)
    • LocalTimeZone
    • AddWeeks
    • Age
    • BeginningOfDay
    • EndOfDay
    • IsToday
    • SetTime
    • UTCOffset
  • Uri Extensions
    • Execute (opens a URL in the default browser)
  • DataTable Extensions
    • ToList
    • ToCSV
    • ToDelimitedFile
  • TimeSpan Extensions
    • Years
    • Months
    • DaysRemainder

  • Modified TrueForAll to accept more than one Predicate.
  • Changed ThrowIfDefault, ThrowIfNull, ThrowIfNullOrDBNull, and ThrowIfNullOrEmpty to return the original value instead of being void.
  • Fixed Remove and RemoveRange so that they would work with fixed length collections, arrays, etc. (Note that the collection is no longer directly changed, the returned value is now the collection minus the removed items)
  • Changed SQLHelper methods that were returning void. They now return the SQLHelper object (basically allowing for a more fluent interface).
  • Added PageCount and PagedCommand functions for MicroORM. These functions take an SQL command to determine the data to return (you can't have an order by clause, but this allows a lot more freedom when coming up with what to return).
  • Changed StopWatch class to actually use System.Diagnostics.Stopwatch class for greater precision when timing. (May remove this class in the future)
  • Switched Save function on ObjectBaseClass to take an IEnumerable instead of a list of objects.
  • Fixed issues in ORM when an item contains a ManyToMany or ManyToOne mapping that is the same type (for instance class A contains a list of type A).
  • Fixed issue in ORM where if string mapping is declared MAX by entering -1 (no longer limits the text in that field to 100 characters).
  • Fixed bug in ORM code so that Readable and Writable fields on the database are respected.

Plus a lot more.

Reviews for this release

No reviews yet for this release.