本文整理汇总了C#中ITreeNode.GetText方法的典型用法代码示例。如果您正苦于以下问题:C# ITreeNode.GetText方法的具体用法?C# ITreeNode.GetText怎么用?C# ITreeNode.GetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITreeNode
的用法示例。
在下文中一共展示了ITreeNode.GetText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitNode
public override void VisitNode(ITreeNode node, IHighlightingConsumer consumer)
{
String s = node.GetText();
if (PsiLexer.IsKeyword(s))
{
AddHighlighting(consumer, node);
}
else
{
var token = node as PsiGenericToken;
if (token != null)
{
if (token.GetTokenType().IsStringLiteral)
{
AddHighlighting(consumer, new PsiStringLiteralHighlighting(node));
}
else if (token.GetTokenType().IsComment)
{
AddHighlighting(consumer, new PsiCommentHighlighting(node));
}
}
}
}
示例2: AddTokensToSymbolTable
private void AddTokensToSymbolTable(ITreeNode tokenTypeClassFQNameNode)
{
myTokenTypeClassFqName = tokenTypeClassFQNameNode.GetText();
myTokenTypeClassFqName = myTokenTypeClassFqName.Substring(1, myTokenTypeClassFqName.Length - 2);
ICollection<ITypeElement> classes =
GetPsiServices().CacheManager.GetDeclarationsCache(GetPsiModule(), false, true).GetTypeElementsByCLRName(
myTokenTypeClassFqName);
IEnumerator<ITypeElement> enumerator = classes.GetEnumerator();
if (enumerator.MoveNext())
{
var tokenTypeClass = enumerator.Current as IClass;
if (tokenTypeClass != null)
{
IEnumerable<IField> fields = tokenTypeClass.Fields;
IList<IDeclaredElement> elements = new List<IDeclaredElement>();
foreach (IField field in fields)
{
if (field.IsReadonly && field.IsStatic)
{
elements.Add(field);
}
}
ISymbolTable tokenSymbolTable = ResolveUtil.CreateSymbolTable(elements, 0);
myRuleSymbolTable = myRuleSymbolTable.Merge(tokenSymbolTable);
}
}
}
示例3: CreateBlock
/// <summary>Creates a block with the content of the given node. </summary>
/// <param name="node">The node which is used as content. </param>
/// <returns>The block. </returns>
public IBlock CreateBlock(ITreeNode node)
{
return _factory.CreateBlock("{ \n$0\n }", node.GetText());
}
示例4: AddDerivedElementsToSymbolTable
private void AddDerivedElementsToSymbolTable(ITreeNode visitorMethodSuffixNode, ITreeNode treeInterfacesPackageNode, ITreeNode parserPackageNode, ITreeNode parserClassNameNode, ITreeNode treeClassesPackageNode, ITreeNode interfacePrefixNode, ITreeNode visitorMethodPrefixNode, ITreeNode visitorClassNameNode)
{
if (parserClassNameNode != null)
{
myParserClassName = parserClassNameNode.GetText();
myParserClassName = myParserClassName.Substring(1, myParserClassName.Length - 2);
}
else
{
myParserClassName = "";
}
if (myParserPackageName != null)
{
myParserPackageName = parserPackageNode.GetText();
myParserPackageName = myParserPackageName.Substring(1, myParserPackageName.Length - 2);
}
else
{
myParserPackageName = "";
}
if (treeInterfacesPackageNode != null)
{
myTreeInterfacesPackageName = treeInterfacesPackageNode.GetText();
myTreeInterfacesPackageName = myTreeInterfacesPackageName.Substring(1, myTreeInterfacesPackageName.Length - 2);
}
else
{
myTreeInterfacesPackageName = "";
}
if (treeClassesPackageNode != null)
{
myTreeClassesPackageName = treeClassesPackageNode.GetText();
myTreeClassesPackageName = myTreeClassesPackageName.Substring(1, myTreeClassesPackageName.Length - 2);
}
else
{
myTreeClassesPackageName = "";
}
if (visitorClassNameNode != null)
{
myVisitorClassName = visitorClassNameNode.GetText();
myVisitorClassName = myVisitorClassName.Substring(1, myVisitorClassName.Length - 2);
}
else
{
myVisitorClassName = "";
}
if (visitorMethodPrefixNode != null)
{
myVisitorMethodPrefix = visitorMethodPrefixNode.GetText();
myVisitorMethodPrefix = myVisitorMethodPrefix.Substring(1, myVisitorMethodPrefix.Length - 2);
}
else
{
myVisitorMethodPrefix = "";
}
if (visitorMethodSuffixNode != null)
{
myVisitorMethodSuffix = visitorMethodSuffixNode.GetText();
myVisitorMethodSuffix = myVisitorMethodSuffix.Substring(1, myVisitorMethodSuffix.Length - 2);
}
else
{
myVisitorMethodSuffix = "";
}
if (interfacePrefixNode != null)
{
myInterfacePrefix = interfacePrefixNode.GetText();
myInterfacePrefix = myInterfacePrefix.Substring(1, myInterfacePrefix.Length - 2);
}
else
{
myInterfacePrefix = "_";
}
//CollectDerivedElements();
}