protected static Tuple<string, string> GetNodeType(SyntaxNode node)
{
var declaration = node as TypeDeclarationSyntax;
if (declaration != null)
{
var keyword = declaration.Keyword.ValueText.ToTitleCase();
var name = declaration.Identifier.ValueText;
return new Tuple<string, string>(keyword, name);
}
if (node.Parent == null)
{
return new Tuple<string, string>(SyntaxFactory.Token(SyntaxKind.GlobalKeyword).ValueText, string.Empty);
}
return GetNodeType(node.Parent);
}