private void GenerateSrcHandlers(
        DomainProjectOptions domainProjectOptions,
        out List <SyntaxGeneratorHandler> sgHandlers)
    {
        ArgumentNullException.ThrowIfNull(domainProjectOptions);

        sgHandlers = new List <SyntaxGeneratorHandler>();
        foreach (var basePathSegmentName in domainProjectOptions.BasePathSegmentNames)
        {
            var generatorHandlers = new SyntaxGeneratorHandlers(logger, domainProjectOptions, basePathSegmentName);
            var generatedHandlers = generatorHandlers.GenerateSyntaxTrees();
            sgHandlers.AddRange(generatedHandlers);
        }

        foreach (var sg in sgHandlers)
        {
            if (!sg.GetFilePath().Exists)
            {
                sg.ToFile();
            }
        }
    }
Ejemplo n.º 2
0
        private static List <LogKeyValueItem> GenerateSrcHandlers(DomainProjectOptions domainProjectOptions, out List <SyntaxGeneratorHandler> sgHandlers)
        {
            if (domainProjectOptions == null)
            {
                throw new ArgumentNullException(nameof(domainProjectOptions));
            }

            var logItems = new List <LogKeyValueItem>();

            sgHandlers = new List <SyntaxGeneratorHandler>();
            foreach (var basePathSegmentName in domainProjectOptions.BasePathSegmentNames)
            {
                var generatorHandlers = new SyntaxGeneratorHandlers(domainProjectOptions, basePathSegmentName);
                var generatedHandlers = generatorHandlers.GenerateSyntaxTrees();
                sgHandlers.AddRange(generatedHandlers);
            }

            foreach (var sg in sgHandlers)
            {
                logItems.Add(sg.ToFile());
            }

            return(logItems);
        }