Convert some C++ functions into C# methods.