static string fieldNames(MemberTypeNameInfo[] infos) { var args = infos.Select(info => "new" + info.name.UppercaseFirst()).ToArray(); return string.Join(", ", args); }
static string fieldNamesWithType(MemberTypeNameInfo[] infos) { var typedArgs = infos.Select(info => { var newArg = "new" + info.name.UppercaseFirst(); var typeString = TypeGenerator.Generate(info.type); return typeString + " " + newArg; }).ToArray(); return string.Join(", ", typedArgs); }
static string fieldAssignments(MemberTypeNameInfo[] infos) { const string format = " component.{0} = {1};"; var assignments = infos.Select(info => { var newArg = "new" + info.name.UppercaseFirst(); return string.Format(format, info.name, newArg); }).ToArray(); return string.Join("\n", assignments); }