Rewrite of code I posted here https://stackoverflow.com/a/13318056/222054
Primary LanguageC#Mozilla Public License 2.0MPL-2.0