コード例 #1
0
 static string fieldNames(MemberTypeNameInfo[] infos)
 {
     var args = infos.Select(info => "new" + info.name.UppercaseFirst()).ToArray();
     return string.Join(", ", args);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }