public GeneratedAssembly(GenerationRules generation) { Generation = generation; }
public GeneratedType(GenerationRules rules, string typeName) { Rules = rules; TypeName = typeName; }
public GeneratedAssembly(GenerationRules rules) { Rules = rules; Namespace = rules.ApplicationNamespace; }
public GeneratedAssembly(GenerationRules rules, string ns) { Namespace = ns; Rules = rules; }
public GeneratedType(GenerationRules rules, string typeName) { Rules = rules; TypeName = typeName; Namespace = rules.ApplicationNamespace; }
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)); }
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); }
public static string ToNamespace(this ICodeFileCollection codeFileCollection, GenerationRules rules) { return($"{rules.ApplicationNamespace}.{codeFileCollection.ChildNamespace}"); }
public DynamicCodeBuilder(GenerationRules rules, IServiceProvider services, IGeneratesCode[] generators) { _rules = rules; _services = services; _generators = generators; }