コード例 #1
0
        public static ISet <ITypeSymbol> GetDependentTypes(Compilation compilation, SyntaxNode methodBody)
        {
            ShaderSyntaxCollector syntaxCollector = new ShaderSyntaxCollector(compilation);

            syntaxCollector.Visit(methodBody);

            return(syntaxCollector.CollectedTypes);
        }
コード例 #2
0
        public static IList <Type> GetDependentTypes(MethodInfo methodInfo)
        {
            Compilation             compilation = GetCompilation(methodInfo.DeclaringType);
            MethodDeclarationSyntax methodNode  = GetMethodDeclaration(methodInfo, compilation.SyntaxTrees.Single());

            ShaderSyntaxCollector syntaxCollector = new ShaderSyntaxCollector(compilation);

            syntaxCollector.Visit(methodNode.Body);

            return(syntaxCollector.CollectedTypes.Distinct().ToList());
        }