コード例 #1
0
        public virtual Task <IEntity> CreateMethodEntityAsync(MethodDescriptor methodDescriptor)
        {
            var libraryMethodVisitor = new LibraryMethodParser(methodDescriptor);
            var methodEntity         = libraryMethodVisitor.ParseMethod();

            return(Task.FromResult <IEntity>(methodEntity));
        }
コード例 #2
0
        public virtual async Task <IEntity> CreateMethodEntityAsync(MethodDescriptor methodDescriptor)
        {
            var methodParserInfo = await this.FindMethodInProjectAsync(methodDescriptor);

            MethodEntity methodEntity = null;

            if (methodParserInfo != null)
            {
                var methodEntityGenerator = new MethodParser(methodParserInfo);
                methodEntity = methodEntityGenerator.ParseMethod();
            }
            else
            {
                var methodEntityGenerator = new LibraryMethodParser(methodDescriptor);
                methodEntity = methodEntityGenerator.ParseMethod();
            }

            // this is for RTA analysis
            if (methodEntity.InstantiatedTypes.Count > 0)
            {
                await this.rtaManager.AddInstantiatedTypesAsync(methodEntity.InstantiatedTypes);
            }

            return(methodEntity);
        }