private void writeConstructorMethod(ISourceWriter writer, IList<InjectedField> args) { var ctorArgs = args.Select(x => x.CtorArgDeclaration).Join(", "); var declaration = $"BLOCK:public {TypeName}({ctorArgs})"; if (BaseConstructorArguments.Any()) declaration = $"{declaration} : base({BaseConstructorArguments.Select(x => x.CtorArg).Join(", ")})"; writer.Write(declaration); foreach (var field in args) field.WriteAssignment(writer); writer.FinishBlock(); }
bool IVariableSource.Matches(Type type) { return(BaseConstructorArguments.Any(x => x.ArgType == type)); }