コード例 #1
0
 public GeneratedAssembly(GenerationRules generation)
 {
     Generation = generation;
 }
コード例 #2
0
ファイル: GeneratedType.cs プロジェクト: vlisovych/lamar
 public GeneratedType(GenerationRules rules, string typeName)
 {
     Rules    = rules;
     TypeName = typeName;
 }
コード例 #3
0
 public GeneratedAssembly(GenerationRules rules)
 {
     Rules     = rules;
     Namespace = rules.ApplicationNamespace;
 }
コード例 #4
0
 public GeneratedAssembly(GenerationRules rules, string ns)
 {
     Namespace = ns;
     Rules     = rules;
 }
コード例 #5
0
 public GeneratedType(GenerationRules rules, string typeName)
 {
     Rules     = rules;
     TypeName  = typeName;
     Namespace = rules.ApplicationNamespace;
 }
コード例 #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));
        }
コード例 #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);
        }
コード例 #8
0
 public static string ToNamespace(this ICodeFileCollection codeFileCollection, GenerationRules rules)
 {
     return($"{rules.ApplicationNamespace}.{codeFileCollection.ChildNamespace}");
 }
コード例 #9
0
 public DynamicCodeBuilder(GenerationRules rules, IServiceProvider services, IGeneratesCode[] generators)
 {
     _rules      = rules;
     _services   = services;
     _generators = generators;
 }