コード例 #1
0
        private SyntaxNode GetKnownParent(SyntaxNode receivedSyntaxNode)
        {
            var typeInfo = receivedSyntaxNode.Parent.GetType().GetTypeInfo();

            if (PossibleParents.Any(parent => parent.Type.GetTypeInfo().IsAssignableFrom(typeInfo)))
            {
                return(receivedSyntaxNode.Parent);
            }

            return(null);
        }
        private bool IsConsideredAsUsed(SyntaxNode receivedSyntaxNode)
        {
            var typeInfo = receivedSyntaxNode.Parent.GetType().GetTypeInfo();

            return(PossibleParents.Any(parent => parent.Type.GetTypeInfo().IsAssignableFrom(typeInfo)));
        }