本文整理汇总了C#中IElement.GetText方法的典型用法代码示例。如果您正苦于以下问题:C# IElement.GetText方法的具体用法?C# IElement.GetText怎么用?C# IElement.GetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IElement
的用法示例。
在下文中一共展示了IElement.GetText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsAvailable
/// <summary>Determines whether this instance is available.</summary>
/// <param name="element">The element.</param>
/// <returns><c>true</c> if this instance is available; otherwise, <c>false</c>.</returns>
public override bool IsAvailable(IElement element)
{
var text = element.GetText();
if (text != "abstract")
{
return false;
}
var parent = element.ToTreeNode().Parent;
if (parent == null)
{
return false;
}
var classNode = parent.Parent;
return classNode is IClassDeclaration;
}
示例2: GetDocCommentText
/// <summary>
/// Gets the doc comment text.
/// </summary>
/// <param name="docCommentBlockNode">
/// The doc comment block node.
/// </param>
/// <returns>
/// The doc comment text.
/// </returns>
private static string GetDocCommentText(IElement docCommentBlockNode)
{
return docCommentBlockNode.GetText();
}
示例3: IsAvailable
/// <summary>
/// Determines whether this instance is available.
/// </summary>
/// <param name="element">
/// The element.
/// </param>
/// <returns>
/// <c>true</c> if this instance is available; otherwise, <c>false</c>.
/// </returns>
protected override bool IsAvailable(IElement element)
{
var text = element.GetText();
if (text != "virtual")
{
return false;
}
var functionDeclaration = element.GetContainingElement<IFunctionDeclaration>(true);
if (functionDeclaration != null)
{
return true;
}
var propertyDeclaration = element.GetContainingElement<IPropertyDeclaration>(true);
if (propertyDeclaration != null)
{
return true;
}
return false;
}