Successfully translated the DLL from VB.NET to C#