コード例 #1
0
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody() && !metadataWriter.MetadataOnly)
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);

                    for (IImportScope scope = body.ImportScope; scope != null; scope = scope.Parent)
                    {
                        if (_alreadySeenScopes.Add(scope))
                        {
                            VisitImports(scope.GetUsedNamespaces());
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else if (!metadataWriter.MetadataOnly)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }
コード例 #2
0
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody())
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);
                }
                else if (!metadataWriter.allowMissingMethodBodies)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }
コード例 #3
0
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody())
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);

                    for (IImportScope scope = body.ImportScope; scope != null; scope = scope.Parent)
                    {
                        if (_alreadySeenScopes.Add(scope))
                        {
                            VisitImports(scope.GetUsedNamespaces(Context));
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else if (!metadataWriter.allowMissingMethodBodies)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }
コード例 #4
0
ファイル: ReferenceIndexer.cs プロジェクト: elemk0vv/roslyn-1
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody())
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);
                }
                else if (!metadataWriter.allowMissingMethodBodies)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }