add the new C# API and add sample code.