FindTypeParameterReferences() 개인적인 메소드

private FindTypeParameterReferences ( IType typeParameter, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void
typeParameter IType
unresolvedFile CSharpUnresolvedFile
syntaxTree SyntaxTree
compilation ICompilation
callback FoundReferenceCallback
cancellationToken System.Threading.CancellationToken
리턴 void
        public IEnumerable <MemberReference> FindInDocument(MonoDevelop.Ide.Gui.Document doc)
        {
            if (string.IsNullOrEmpty(memberName))
            {
                return(Enumerable.Empty <MemberReference> ());
            }
            var editor         = doc.Editor;
            var parsedDocument = doc.ParsedDocument;

            if (parsedDocument == null)
            {
                return(Enumerable.Empty <MemberReference> ());
            }
            var unit   = parsedDocument.GetAst <SyntaxTree> ();
            var file   = parsedDocument.ParsedFile as CSharpUnresolvedFile;
            var result = new List <MemberReference> ();

            foreach (var obj in searchedMembers)
            {
                if (obj is IEntity)
                {
                    var entity = (IEntity)obj;

                    // May happen for anonymous types since empty constructors are always generated.
                    // But there is no declaring type definition for them - we filter out this case.
                    if (entity.EntityType == EntityType.Constructor && entity.DeclaringTypeDefinition == null)
                    {
                        continue;
                    }

                    refFinder.FindReferencesInFile(refFinder.GetSearchScopes(entity), file, unit, doc.Compilation, (astNode, r) => {
                        if (IsNodeValid(obj, astNode))
                        {
                            result.Add(GetReference(r, astNode, editor.FileName, editor));
                        }
                    }, CancellationToken.None);
                }
                else if (obj is IVariable)
                {
                    refFinder.FindLocalReferences((IVariable)obj, file, unit, doc.Compilation, (astNode, r) => {
                        if (IsNodeValid(obj, astNode))
                        {
                            result.Add(GetReference(r, astNode, editor.FileName, editor));
                        }
                    }, CancellationToken.None);
                }
                else if (obj is ITypeParameter)
                {
                    refFinder.FindTypeParameterReferences((ITypeParameter)obj, file, unit, doc.Compilation, (astNode, r) => {
                        if (IsNodeValid(obj, astNode))
                        {
                            result.Add(GetReference(r, astNode, editor.FileName, editor));
                        }
                    }, CancellationToken.None);
                }
            }
            return(result);
        }
        public IEnumerable <MemberReference> FindInDocument(MonoDevelop.Ide.Gui.Document doc)
        {
            if (string.IsNullOrEmpty(memberName))
            {
                return(Enumerable.Empty <MemberReference> ());
            }
            var editor         = doc.Editor;
            var parsedDocument = doc.ParsedDocument;

            if (parsedDocument == null)
            {
                return(Enumerable.Empty <MemberReference> ());
            }
            var unit   = parsedDocument.GetAst <CompilationUnit> ();
            var file   = parsedDocument.ParsedFile as CSharpParsedFile;
            var result = new List <MemberReference> ();

            foreach (var obj in searchedMembers)
            {
                if (obj is IEntity)
                {
                    refFinder.FindReferencesInFile(refFinder.GetSearchScopes((IEntity)obj), file, unit, doc.Compilation, (astNode, r) =>
                    {
                        if (IsNodeValid(obj, astNode))
                        {
                            result.Add(GetReference(r, astNode, editor.FileName, editor));
                        }
                    }, CancellationToken.None);
                }
                else if (obj is IVariable)
                {
                    refFinder.FindLocalReferences((IVariable)obj, file, unit, doc.Compilation, (astNode, r) =>
                    {
                        if (IsNodeValid(obj, astNode))
                        {
                            result.Add(GetReference(r, astNode, editor.FileName, editor));
                        }
                    }, CancellationToken.None);
                }
                else if (obj is ITypeParameter)
                {
                    refFinder.FindTypeParameterReferences((ITypeParameter)obj, file, unit, doc.Compilation, (astNode, r) =>
                    {
                        if (IsNodeValid(obj, astNode))
                        {
                            result.Add(GetReference(r, astNode, editor.FileName, editor));
                        }
                    }, CancellationToken.None);
                }
            }
            return(result);
        }
 public override void RenameTypeParameter(IType type, string name = null)
 {
     FindReferences refFinder = new FindReferences ();
     refFinder.FindTypeParameterReferences (type,
                                    context.UnresolvedFile,
                                    context.RootNode as SyntaxTree,
                                    context.Compilation, (n, r) => Rename (n, name),
                                    context.CancellationToken);
 }