Example #1
0
        public void CodeGen(CodeBuilder builder)
        {
            if (string.IsNullOrEmpty(Namespace))
            {
                throw new InvalidOperationException("Kein Namespace angegeben");
            }

            // Header
            if (!string.IsNullOrEmpty(Header))
            {
                builder.AppendMultiLineComment(Header);
            }

            // Using-Direktiven
            foreach (string u in Usings)
            {
                builder.AppendToken("using");
                builder.AppendToken(u);
                builder.EndOfStatement();
            }

            builder.EndOfLineBlock();

            // Namespace
            builder.AppendToken("namespace");
            builder.AppendToken(Namespace);
            builder.BeginBlock();

            // Inhalt
            foreach (var module in Modules)
            {
                module.CodeGen(builder);
            }

            builder.EndBlock();
        }