public override CSCodeGenerationResult Implement(IActivityMonitor monitor, Type classType, ICSCodeGenerationContext c, ITypeScope scope) { var helper = new SourceCodeHelper1(); c.CurrentRun.ServiceContainer.Add(helper); c.CurrentRun.ServiceContainer.Add <ISourceCodeHelper1>(helper); return(new CSCodeGenerationResult(typeof(ActualImpl1))); }
// The implementor type can rely on its creator (here it has access to the AutoImpl1 and, as a nested type, // it can access its private fields). public ActualImpl1(AutoImpl1 theOwner, SourceCodeHelper1 h1, SourceCodeHelper2 h2) { _theOwner = theOwner; _h1 = h1; _h2 = h2; }