C# script generation