Craig’s Utility Library 3.1 Released

3/25/2012

Yesterday I released the latest version of Craig's Utility Library. This version contains a number of updates and additions including:

Additions

  • 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

Fixes/Updates
  • 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.
  • Bitmap extensions are now multithreaded and thus much faster.

And there's even a bit more in there, but I'm tired of writing at the moment. So go, download the latest version and happy coding... Oh and I just realized that apparently my nightly build broke around the end of February. Apparently the hodgepodge of third party tools that I assembled didn't work well together... Anyway, I'll hopefully get that up and running again soon.



Comments