Пример #1
0
        private static bool FoundPreprocessorInThisNode(ConditionalDirectiveTriviaSyntax node, string preprocessor)
        {
            if (node == null || preprocessor == null)
            {
                return(false);
            }

            var children = node.Condition.DescendantNodesAndSelf();

            return(children.Where((n) =>
            {
                if (n.Kind() == SyntaxKind.IdentifierName &&
                    n.Parent?.Kind() != SyntaxKind.LogicalNotExpression &&
                    (n as IdentifierNameSyntax).Identifier.ValueText.Equals(preprocessor))
                {
                    return true;
                }

                return false;
            }).Count() > 0);
        }
Пример #2
0
 public TameConditionalDirectiveTriviaSyntax(ConditionalDirectiveTriviaSyntax node)
 {
     Node = node;
     AddChildren();
 }