RenameReferencesInFile() public method

public RenameReferencesInFile ( IList searchScopes, string newName, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, Action callback, Action errorCallback, CancellationToken cancellationToken = default(CancellationToken) ) : void
searchScopes IList
newName string
resolver ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver
callback Action
errorCallback Action
cancellationToken System.Threading.CancellationToken
return void
Esempio n. 1
0
        IList <AstNode> Rename(string fullyQualifiedName, string newName, bool includeOverloads)
        {
            var sym = GetSymbol(compilation, fullyQualifiedName);

            Assert.NotNull(sym);
            var graph = new TypeGraph(compilation.Assemblies);
            var col   = new SymbolCollector();

            col.IncludeOverloads = includeOverloads;
            col.GroupForRenaming = true;
            var            scopes = findReferences.GetSearchScopes(col.GetRelatedSymbols(graph, sym));
            List <AstNode> result = new List <AstNode>();

            findReferences.RenameReferencesInFile(
                scopes,
                newName,
                new CSharpAstResolver(compilation, syntaxTree, unresolvedFile),
                delegate(RenameCallbackArguments obj) {
                result.Add(obj.NodeToReplace);
            },
                delegate(Error obj) {
            });
            return(result);
        }