Esempio n. 1
0
            private static bool ContainsOnlyWhitespaceTrivia(StatementSyntax statement)
            {
                foreach (var token in statement.DescendantTokens())
                {
                    foreach (var trivia in token.LeadingTrivia.Concat(token.TrailingTrivia))
                    {
                        if (trivia.Kind() != SyntaxKind.WhitespaceTrivia &&
                            trivia.Kind() != SyntaxKind.EndOfLineTrivia)
                        {
                            return(false);
                        }
                    }
                }

                return(true);
            }
            private static bool ContainsOnlyWhitespaceTrivia(StatementSyntax statement)
            {
                foreach (var token in statement.DescendantTokens())
                {
                    foreach (var trivia in token.LeadingTrivia.Concat(token.TrailingTrivia))
                    {
                        if (trivia.Kind() != SyntaxKind.WhitespaceTrivia &&
                            trivia.Kind() != SyntaxKind.EndOfLineTrivia)
                        {
                            return false;
                        }
                    }
                }

                return true;
            }