Exemplo n.º 1
0
        public override void Render(CompilationUnitSource source)
        {
            source.AddLine($"public enum {Name}");
            source.StartBlock();

            foreach (string literal in Literals)
            {
                source.AddLine($"{literal},");
            }
            source.EndBlock();
        }
Exemplo n.º 2
0
        public override void Render(CompilationUnitSource source)
        {
            if (Namespace != null)
            {
                source.AddLine($"namespace {Namespace}");
                source.StartBlock();
            }

            foreach (CompilationUnitFragment fragment in Fragments)
            {
                fragment.Render(source);
            }

            if (Namespace != null)
            {
                source.EndBlock();
            }
        }
Exemplo n.º 3
0
        public override void Render(CompilationUnitSource source)
        {
            string extends = "";

            if (BaseClass != null)
            {
                extends = $" : {BaseClass}";
            }

            source.AddLine($"public class {Name}{extends}");
            source.StartBlock();

            foreach (CompilationUnitField field in Fields)
            {
                field.Render(source);
            }
            source.EndBlock();
        }