Scripted creation of terrains(C#)

I’m trying to create a program that will generate an infinite terrain so far I have already programmed a height map generator (trough I have done so in java and will have to translate it to C#) Now I need to find a way to create additional terrains so I can link them to my heightmap. Does anybody know how to do this?

Basically I’m looking for a code in c# that once finished leaves me with a terrain object of the desired size and of which I can alter the height map as well as the used textures ext. A example code or a link to a tutorial are both very useful.