public class CodeGearExample : CodeGear { [Take] public CountObject count; public override void Run(CodeGearManager cgm) { Console.WriteLine(count); if (count < 10) { cgm.Setup(new CodeGearExample()); count.number += 1; put("count", count); } else { cgm.GetLocalDGM().Finish(); } } }