private GetEntityMarkup ( SyntaxNode node ) : string | ||
node | SyntaxNode | |
return | string |
public string GetMarkup(int n) { if (tag is DotNetProject) { return(GLib.Markup.EscapeText(ext.ownerProjects [n].Name)); } var node = memberList [n]; if (tag is SyntaxTree) { var type = node; if (type != null) { var sb = new StringBuilder(); sb.Append(ext.GetEntityMarkup(type)); while (type.Parent is BaseTypeDeclarationSyntax) { sb.Insert(0, ext.GetEntityMarkup(type.Parent) + "."); type = type.Parent; } return(sb.ToString()); } } return(ext.GetEntityMarkup(node)); }
public string GetMarkup(int n) { var node = memberList [n]; if (tag is SyntaxTree) { var type = node; if (type != null) { var sb = new StringBuilder(); sb.Append(ext.GetEntityMarkup(type)); while (type.Parent is TypeDeclaration) { sb.Insert(0, ext.GetEntityMarkup(type.Parent) + "."); type = type.Parent; } return(sb.ToString()); } } return(ext.GetEntityMarkup(node)); }
string GetName(SyntaxNode node) { if (tag is SyntaxTree) { var type = node; if (type != null) { var sb = StringBuilderCache.Allocate(); sb.Append(ext.GetEntityMarkup(type)); while (type.Parent is BaseTypeDeclarationSyntax) { sb.Insert(0, ext.GetEntityMarkup(type.Parent) + "."); type = type.Parent; } return(StringBuilderCache.ReturnAndFree(sb)); } } var accessor = node as AccessorDeclarationSyntax; if (accessor != null) { if (accessor.Kind() == SyntaxKind.GetAccessorDeclaration) { return("get"); } if (accessor.Kind() == SyntaxKind.SetAccessorDeclaration) { return("set"); } if (accessor.Kind() == SyntaxKind.AddAccessorDeclaration) { return("add"); } if (accessor.Kind() == SyntaxKind.RemoveAccessorDeclaration) { return("remove"); } return(node.ToString()); } if (node is OperatorDeclarationSyntax) { return("operator"); } if (node is PropertyDeclarationSyntax) { return(((PropertyDeclarationSyntax)node).Identifier.ToString()); } if (node is MethodDeclarationSyntax) { return(((MethodDeclarationSyntax)node).Identifier.ToString()); } if (node is ConstructorDeclarationSyntax) { return(((ConstructorDeclarationSyntax)node).Identifier.ToString()); } if (node is DestructorDeclarationSyntax) { return(((DestructorDeclarationSyntax)node).Identifier.ToString()); } if (node is BaseTypeDeclarationSyntax) { return(((BaseTypeDeclarationSyntax)node).Identifier.ToString()); } // if (node is fixeds) { // return ((FixedVariableInitializer)node).Name; // } if (node is VariableDeclaratorSyntax) { return(((VariableDeclaratorSyntax)node).Identifier.ToString()); } return(node.ToString()); }