Ejemplo n.º 1
0
    private void WalkTree(List <GeneratedWrapper> result, SyntaxTree tree)
    {
        var typesToWrap = _walker.Process(tree.GetRoot(), _compilation.GetSemanticModel(tree));

        PushToWrap(typesToWrap);
        while (_typesToWrap.Count > 0)
        {
            var typeInfo       = _typesToWrap.Pop();
            var sourceTypeName = GeneratedTypeFilter.SourceTypeName(typeInfo);
            if (!result.Any(x => x.SourceTypeFullName == sourceTypeName) &&
                GeneratedTypeFilter.TryGetGeneratableType(typeInfo, out var typeInfoToGenerate))
            {
                var generatedTypeResult = _typeBuilder.BuildWrapperType(typeInfoToGenerate, sourceTypeName);
                PushToWrap(generatedTypeResult.ToProcessTypes);
                result.Add(generatedTypeResult);
            }
        }
    }