Exemplo n.º 1
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("using System;\r\nusing System.IO;\r\n\r\nnamespace ");

            #line 9 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.Namespace)));

            #line default
            #line hidden
            this.Write("\r\n{\r\n    public static partial class GameServer\r\n    {\r\n        private static ");

            #line 13 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.GameState)));

            #line default
            #line hidden
            this.Write(" ReadTurn()\r\n        {\r\n            Console.WriteLine(\"EOT\");\r\n            string" +
                       " line = Console.ReadLine();\r\n            if (line.StartsWith(\"EOT\"))\r\n          " +
                       "      return null;\r\n            Parser parser = new Parser(line);\r\n            ");

            #line 20 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.GameState)));

            #line default
            #line hidden
            this.Write(" turn = new ");

            #line 20 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.GameState)));

            #line default
            #line hidden
            this.Write("();\r\n            parser.Deserialize(turn);\r\n            return turn;\r\n        }\r\n" +
                       "        \r\n        private static Tuple<");

            #line 25 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.GameSetup)));

            #line default
            #line hidden
            this.Write(", ");

            #line 25 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.PlayerSetup)));

            #line default
            #line hidden
            this.Write(@"> ReadSetup()
        {
            string line = Console.ReadLine();
            Parser parser = new Parser(line);
            int playerId = parser.ReadNextInt();
            line = Console.ReadLine();
            parser = new Parser(line);
            ");

            #line 32 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.GameSetup)));

            #line default
            #line hidden
            this.Write(" data = new ");

            #line 32 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.GameSetup)));

            #line default
            #line hidden
            this.Write("();\r\n            parser.Deserialize(data);\r\n            return Tuple.Create(data," +
                       " data.Player[playerId]);\r\n        }\r\n\r\n        private class Parser\r\n        {\r\n" +
                       "            private string Line;\r\n            private int Index = 0;\r\n\r\n        " +
                       "    public Parser(string line)\r\n            {\r\n                Line = line;\r\n   " +
                       "         }\r\n\r\n            public long ReadNextLong()\r\n            {\r\n           " +
                       "     long data = 0;\r\n                bool negative = false;\r\n                if " +
                       "(Index < Line.Length && Line[Index] == \'-\')\r\n                {\r\n                " +
                       "    negative = true;\r\n                    ++Index;\r\n                }\r\n\r\n       " +
                       "         while (Index < Line.Length && Line[Index] >= \'0\' && Line[Index] <= \'9\')" +
                       "\r\n                {\r\n                    data *= 10;\r\n                    data +" +
                       "= (long)(Line[Index] - \'0\');\r\n                    ++Index;\r\n                }\r\n " +
                       "               ++Index;\r\n                return negative ? -data : data;\r\n      " +
                       "      }\r\n            \r\n            public ulong ReadNextUlong()\r\n            {\r\n" +
                       "                ulong data = 0;\r\n\r\n                while (Index < Line.Length &&" +
                       " Line[Index] >= \'0\' && Line[Index] <= \'9\')\r\n                {\r\n                 " +
                       "   data *= 10;\r\n                    data += (ulong)(Line[Index] - \'0\');\r\n       " +
                       "             ++Index;\r\n                }\r\n                ++Index;\r\n            " +
                       "    return data;\r\n            }\r\n            \r\n            public int ReadNextIn" +
                       "t()\r\n            {\r\n                return (int)ReadNextLong();\r\n            }\r\n" +
                       "            \r\n            public short ReadNextShort()\r\n            {\r\n         " +
                       "       return (short)ReadNextLong();\r\n            }\r\n            \r\n            p" +
                       "ublic sbyte ReadNextSbyte()\r\n            {\r\n                return (sbyte)ReadNe" +
                       "xtLong();\r\n            }\r\n            \r\n            public uint ReadNextUint()\r\n" +
                       "            {\r\n                return (uint)ReadNextUlong();\r\n            }\r\n   " +
                       "         \r\n            public ushort ReadNextUshort()\r\n            {\r\n          " +
                       "      return (ushort)ReadNextUlong();\r\n            }\r\n            \r\n            " +
                       "public byte ReadNextByte()\r\n            {\r\n                return (byte)ReadNext" +
                       "Ulong();\r\n            }\r\n            \r\n            public char ReadNextChar()\r\n " +
                       "           {\r\n                return (char)ReadNextUlong();\r\n            }\r\n    " +
                       "        \r\n            public bool ReadNextBool()\r\n            {\r\n               " +
                       " return ReadNextLong() != 0;\r\n            }");

            #line 119 "D:\ugly\CodeGenerator\cs\CsImpl.tt"


            foreach (GameClass c in CsHelper.Definition.Class.Values)
            {
            #line default
            #line hidden
                this.Write("\r\n\r\n            public void Deserialize(");

            #line 126 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(c.Name)));

            #line default
            #line hidden
                this.Write(" data)\r\n            {");

            #line 127 "D:\ugly\CodeGenerator\cs\CsImpl.tt"


                foreach (ClassMember m in c.Member)
                {
            #line default
            #line hidden
                    this.Write("\r\n                {");

            #line 133 "D:\ugly\CodeGenerator\cs\CsImpl.tt"


                    BasicType type = CsHelper.Definition.GetBasicType(m.Type);
                    if (m.Array == 0)
                    {
                        if (type.IsBasic())
                        {
            #line default
            #line hidden
                            this.Write("\r\n                    data.");

            #line 142 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Name)));

            #line default
            #line hidden
                            this.Write(" = ReadNext");

            #line 142 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.GetBasicTypeName(type))));

            #line default
            #line hidden
                            this.Write("();");

            #line 142 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }
                        else if (type == BasicType.Class)
                        {
            #line default
            #line hidden
                            this.Write("\r\n                    Deserialize(data.");

            #line 148 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Name)));

            #line default
            #line hidden
                            this.Write(");");

            #line 148 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }
                        else // Enum
                        {
            #line default
            #line hidden
                            this.Write("\r\n                    data.");

            #line 154 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Name)));

            #line default
            #line hidden
                            this.Write(" = (");

            #line 154 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Type)));

            #line default
            #line hidden
                            this.Write(")ReadNextInt();");

            #line 154 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }
                    }
                    else
                    {
                        for (int i = 0; i < m.Array; ++i)
                        {
            #line default
            #line hidden
                            this.Write("\r\n                    int size");

            #line 163 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden
                            this.Write(" = ReadNextInt();");

            #line 163 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }

            #line default
            #line hidden
                        this.Write("\r\n                    data.");

            #line 166 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Name)));

            #line default
            #line hidden
                        this.Write(" = new ");

            #line 166 "D:\ugly\CodeGenerator\cs\CsImpl.tt"

                        if (type.IsBasic())
                        {
            #line default
            #line hidden

            #line 169 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(CsHelper.GetBasicTypeName(type)));

            #line default
            #line hidden

            #line 169 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }
                        else
                        {
            #line default
            #line hidden

            #line 173 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Type)));

            #line default
            #line hidden

            #line 173 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }


            #line default
            #line hidden
                        this.Write("[");

            #line 175 "D:\ugly\CodeGenerator\cs\CsImpl.tt"

                        for (int i = 0; i < m.Array; ++i)
                        {
                            if (i != 0)
                            {
            #line default
            #line hidden
                                this.Write(", ");

            #line 180 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            }


            #line default
            #line hidden
                            this.Write("size");

            #line 182 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden

            #line 182 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }


            #line default
            #line hidden
                        this.Write("];");

            #line 184 "D:\ugly\CodeGenerator\cs\CsImpl.tt"


                        for (int i = 0; i < m.Array; ++i)
                        {
            #line default
            #line hidden
                            this.Write("\r\n                    for (int idx");

            #line 190 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden
                            this.Write(" = 0; idx");

            #line 190 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden
                            this.Write(" < size");

            #line 190 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden
                            this.Write("; ++idx");

            #line 190 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden
                            this.Write(")\r\n                    {");

            #line 191 "D:\ugly\CodeGenerator\cs\CsImpl.tt"

                            this.PushIndent("    ");
                        }
                        if (type == BasicType.Class)
                        {
            #line default
            #line hidden
                            this.Write("\r\n                    ");

            #line 197 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Type)));

            #line default
            #line hidden
                            this.Write(" element = new ");

            #line 197 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Type)));

            #line default
            #line hidden
                            this.Write("();\r\n                    Deserialize(element);");

            #line 198 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }

            #line default
            #line hidden
                        this.Write("\r\n                    data.");

            #line 201 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Name)));

            #line default
            #line hidden
                        this.Write("[idx0");

            #line 201 "D:\ugly\CodeGenerator\cs\CsImpl.tt"

                        for (int i = 1; i < m.Array; ++i)
                        {
            #line default
            #line hidden
                            this.Write(", idx");

            #line 204 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden

            #line 204 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }


            #line default
            #line hidden
                        this.Write("] = ");

            #line 206 "D:\ugly\CodeGenerator\cs\CsImpl.tt"

                        if (type == BasicType.Class)
                        {
            #line default
            #line hidden
                            this.Write("element");

            #line 209 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }
                        else
                        {
            #line default
            #line hidden
                            this.Write("ReadNext");

            #line 213 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.GetBasicTypeName(type))));

            #line default
            #line hidden
                            this.Write("()");

            #line 213 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }


            #line default
            #line hidden
                        this.Write(";");

            #line 215 "D:\ugly\CodeGenerator\cs\CsImpl.tt"


                        for (int i = 0; i < m.Array; ++i)
                        {
                            this.PopIndent();


            #line default
            #line hidden
                            this.Write("\r\n                    }");

            #line 222 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                        }
                    }


            #line default
            #line hidden
                    this.Write("\r\n                }");

            #line 227 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
                }


            #line default
            #line hidden
                this.Write("           \r\n            }");

            #line 232 "D:\ugly\CodeGenerator\cs\CsImpl.tt"
            }


            #line default
            #line hidden
            this.Write("\r\n        }\r\n    }\r\n}");
            return(this.GenerationEnvironment.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("using System;\r\n\r\nnamespace ");

            #line 8 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Config.Namespace)));

            #line default
            #line hidden
            this.Write("\r\n{");

            #line 9 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

            foreach (GameEnum e in CsHelper.CurrentFile.Enum)
            {
            #line default
            #line hidden
                this.Write("\r\n    \r\n    public enum ");

            #line 15 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(e.Name)));

            #line default
            #line hidden
                this.Write("\r\n    {");

            #line 16 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                foreach (KeyValuePair <string, int> kvp in e.Value)
                {
            #line default
            #line hidden
                    this.Write("        \r\n        ");

            #line 21 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(kvp.Key)));

            #line default
            #line hidden
                    this.Write(" = ");

            #line 21 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(kvp.Value));

            #line default
            #line hidden
                    this.Write(",");

            #line 21 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n    }");

            #line 25 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
            }

            foreach (GameClass c in CsHelper.CurrentFile.Class)
            {
            #line default
            #line hidden
                this.Write("\r\n\r\n    public class ");

            #line 33 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(c.Name)));

            #line default
            #line hidden
                this.Write("\r\n    {");

            #line 34 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                foreach (ClassMember m in c.Member)
                {
            #line default
            #line hidden
                    this.Write("\r\n        public ");

            #line 39 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                    BasicType type = CsHelper.Definition.GetBasicType(m.Type);
                    if (type.IsBasic())
                    {
            #line default
            #line hidden

            #line 43 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(CsHelper.GetBasicTypeName(type)));

            #line default
            #line hidden

            #line 43 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    }
                    else
                    {
            #line default
            #line hidden

            #line 47 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Type)));

            #line default
            #line hidden

            #line 47 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    }
                    if (m.Array != 0)
                    {
            #line default
            #line hidden
                        this.Write("[");

            #line 51 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                        for (int i = 1; i < m.Array; ++i)
                        {
            #line default
            #line hidden
                            this.Write(",");

            #line 54 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        }


            #line default
            #line hidden
                        this.Write("]");

            #line 56 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    }


            #line default
            #line hidden
                    this.Write(" ");

            #line 58 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Name)));

            #line default
            #line hidden
                    this.Write(";");

            #line 58 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n        ");

            #line 62 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                foreach (ClassMethod m in c.Method)
                {
            #line default
            #line hidden
                    this.Write("\r\n        public void ");

            #line 67 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(m.Name)));

            #line default
            #line hidden
                    this.Write("(");

            #line 67 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                    for (int idxParam = 0; idxParam < m.Param.Count; ++idxParam)
                    {
                        MethodParam a    = m.Param[idxParam];
                        BasicType   type = CsHelper.Definition.GetBasicType(a.Type);
                        if (idxParam != 0)
                        {
            #line default
            #line hidden
                            this.Write(", ");

            #line 74 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        }
                        if (type.IsBasic())
                        {
            #line default
            #line hidden

            #line 78 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(CsHelper.GetBasicTypeName(type)));

            #line default
            #line hidden

            #line 78 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        }
                        else
                        {
            #line default
            #line hidden

            #line 82 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(a.Type)));

            #line default
            #line hidden

            #line 82 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        }


            #line default
            #line hidden
                        this.Write(" ");

            #line 84 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(Case.LowerCamelCase.Convert(a.Name)));

            #line default
            #line hidden

            #line 84 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    }


            #line default
            #line hidden
                    this.Write(")\r\n        {\r\n            Console.WriteLine(\"");

            #line 88 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(m.MethodId));

            #line default
            #line hidden

            #line 88 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                    for (int idxParam = 0; idxParam < m.Param.Count; ++idxParam)
                    {
            #line default
            #line hidden
                        this.Write(" {");

            #line 91 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(idxParam));

            #line default
            #line hidden
                        this.Write("}");

            #line 91 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                    }


            #line default
            #line hidden
                    this.Write("\"");

            #line 93 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                    foreach (MethodParam a in m.Param)
                    {
            #line default
            #line hidden
                        this.Write(", ");

            #line 96 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                        BasicType type = CsHelper.Definition.GetBasicType(a.Type);
                        switch (type)
                        {
                        case BasicType.Bool:


            #line default
            #line hidden

            #line 101 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.LowerCamelCase.Convert(a.Name)));

            #line default
            #line hidden
                            this.Write(" ? 1 : 0");

            #line 101 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                            break;

                        case BasicType.Char:
                        case BasicType.Enum:


            #line default
            #line hidden
                            this.Write("(int)");

            #line 105 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.LowerCamelCase.Convert(a.Name)));

            #line default
            #line hidden

            #line 105 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                            break;

                        case BasicType.Class:


            #line default
            #line hidden

            #line 108 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.LowerCamelCase.Convert(a.Name)));

            #line default
            #line hidden
                            this.Write(".");

            #line 108 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.CamelCase.Convert(CsHelper.Definition.Class[a.Type].IdMember.Name)));

            #line default
            #line hidden

            #line 108 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                            break;

                        default:


            #line default
            #line hidden

            #line 111 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(Case.LowerCamelCase.Convert(a.Name)));

            #line default
            #line hidden

            #line 111 "D:\ugly\CodeGenerator\cs\CsHeader.tt"

                            break;
                        }
                    }


            #line default
            #line hidden
                    this.Write(");\r\n        }");

            #line 116 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n    }");

            #line 120 "D:\ugly\CodeGenerator\cs\CsHeader.tt"
            }


            #line default
            #line hidden
            this.Write("\r\n}");
            return(this.GenerationEnvironment.ToString());
        }