Working csharp wrapper, needs further testing/refinement