Exemplo n.º 1
0
 public GeneratedAssembly(GenerationRules generation)
 {
     Generation = generation;
 }
Exemplo n.º 2
0
 public GeneratedType(GenerationRules rules, string typeName)
 {
     Rules    = rules;
     TypeName = typeName;
 }
Exemplo n.º 3
0
 public GeneratedAssembly(GenerationRules rules)
 {
     Rules     = rules;
     Namespace = rules.ApplicationNamespace;
 }
Exemplo n.º 4
0
 public GeneratedAssembly(GenerationRules rules, string ns)
 {
     Namespace = ns;
     Rules     = rules;
 }
Exemplo n.º 5
0
 public GeneratedType(GenerationRules rules, string typeName)
 {
     Rules     = rules;
     TypeName  = typeName;
     Namespace = rules.ApplicationNamespace;
 }
Exemplo n.º 6
0
        public static GeneratedAssembly StartAssembly(this ICodeFileCollection generator, GenerationRules rules)
        {
            if (generator.ChildNamespace.IsEmpty())
            {
                throw new InvalidOperationException($"Missing {nameof(ICodeFileCollection.ChildNamespace)} for {generator}");
            }

            var @namespace = $"{rules.ApplicationNamespace}.{generator.ChildNamespace}";

            return(new GeneratedAssembly(rules, @namespace));
        }
Exemplo n.º 7
0
        public static GeneratedAssembly AssembleTypes(this ICodeFileCollection generator, GenerationRules rules)
        {
            var generatedAssembly = generator.StartAssembly(rules);

            foreach (var file in generator.BuildFiles())
            {
                file.AssembleTypes(generatedAssembly);
            }

            return(generatedAssembly);
        }
Exemplo n.º 8
0
 public static string ToNamespace(this ICodeFileCollection codeFileCollection, GenerationRules rules)
 {
     return($"{rules.ApplicationNamespace}.{codeFileCollection.ChildNamespace}");
 }
Exemplo n.º 9
0
 public DynamicCodeBuilder(GenerationRules rules, IServiceProvider services, IGeneratesCode[] generators)
 {
     _rules      = rules;
     _services   = services;
     _generators = generators;
 }