C#: added %newobject declaration for factory functions