ICSharpCode.NRefactory.CSharp.Resolver.FindReferences.GetSearchScopes C# (CSharp) Méthode

GetSearchScopes() public méthode

public GetSearchScopes ( IEnumerable symbols ) : IList
symbols IEnumerable
Résultat IList
		public IList<IFindReferenceSearchScope> GetSearchScopes(IEnumerable<ISymbol> symbols)
		{
			if (symbols == null)
				throw new ArgumentNullException("symbols");
			return symbols.SelectMany(GetSearchScopes).ToList();
		}
		

Same methods

FindReferences::GetSearchScopes ( ISymbol symbol ) : IList

Usage Example

        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);
        }
All Usage Examples Of ICSharpCode.NRefactory.CSharp.Resolver.FindReferences::GetSearchScopes