add C# version

no concessions to trying to reduce the SLOC
Merge pull request #16 from Porges/csharp

add C# version