Exemplo n.º 1
0
            internal static bool Uses(SyntaxNode scope, MemberPath.PathWalker backing, Search search, ITypeSymbol containingType, SemanticModel semanticModel, CancellationToken cancellationToken)
            {
                using (var walker = Borrow(scope, search, containingType, semanticModel, cancellationToken))
                {
                    foreach (var used in walker.usedMembers)
                    {
                        using var usedPath = MemberPath.PathWalker.Borrow(used);
                        if (PropertyPath.Equals(usedPath, backing))
                        {
                            return(true);
                        }
                    }
                }

                return(false);
            }
Exemplo n.º 2
0
        private static bool Equals(MemberPath.PathWalker xWalker, MemberPath.PathWalker yWalker)
        {
            var xPath = xWalker.Tokens;
            var yPath = yWalker.Tokens;

            if (xPath.Count == 0 ||
                xPath.Count != yPath.Count)
            {
                return(false);
            }

            for (var i = 0; i < xPath.Count; i++)
            {
                if (xPath[i].ValueText != yPath[i].ValueText)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 3
0
 internal static bool Uses(SyntaxNode scope, MemberPath.PathWalker memberPath, SyntaxNodeAnalysisContext context)
 {
     return(UsedMemberWalker.Uses(scope, memberPath, Search.Recursive, context.ContainingSymbol.ContainingType, context.SemanticModel, context.CancellationToken));
 }