当前位置: 首页>>代码示例>>C#>>正文


C# ITreeNode.GetTokenType方法代码示例

本文整理汇总了C#中ITreeNode.GetTokenType方法的典型用法代码示例。如果您正苦于以下问题:C# ITreeNode.GetTokenType方法的具体用法?C# ITreeNode.GetTokenType怎么用?C# ITreeNode.GetTokenType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITreeNode的用法示例。


在下文中一共展示了ITreeNode.GetTokenType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindDeclaredElement

		public DeclaredElementInstance FindDeclaredElement(ITreeNode node, IFile file, out TextRange sourceRange) {
			TokenNodeType tokenType = node.GetTokenType();

			if (tokenType == CSharpTokenType.VAR_KEYWORD)
				return FindElementFromVarKeyword(node, file, out sourceRange);

			if (tokenType == CSharpTokenType.NEW_KEYWORD)
				return FindElementFromNewKeyword(node, file, out sourceRange);

			sourceRange = TextRange.InvalidRange;
			return null;
		}
开发者ID:ShaunTGO,项目名称:ReSharper.EnhancedTooltip,代码行数:12,代码来源:CSharpSpecialDeclaredElementFinder.cs

示例2: ProcessBeforeInterior

		/// <summary>
		/// Processes a node, before its descendants are processed.
		/// </summary>
		/// <param name="element">The node to process.</param>
		public override void ProcessBeforeInterior(ITreeNode element) {
			var errorElement = element as MissingTokenErrorElement;
			if (errorElement != null) {
				AddHighlighting(new HighlightingInfo(GetMissingTokenRange(errorElement), new MissingTokenHighlighting(errorElement)));
				return;
			}

			// can't have a statement block (<# #>) after a feature block (<#+ #>)
			var statementBlock = element as T4StatementBlock;
			if (statementBlock != null && _gotFeature) {
				AddHighlighting(new HighlightingInfo(element.GetHighlightingRange(), new StatementAfterFeatureHighlighting(statementBlock)));
				return;
			}

			// verify that a directive attribute value is valid
			if (element.GetTokenType() == T4TokenNodeTypes.Value) {
				ProcessAttributeValue((T4Token) element);
				return;
			}

			var directive = element as IT4Directive;
			if (directive != null)
				ProcessDirective(directive);

			else if (element is T4FeatureBlock) {
				_gotFeature = true;
				if (element == _lastFeature) {
					_gotLastFeature = true;
					_inLastFeature = true;
					return;
				}
			}

			// can't have anything after the last feature block
			if (!_gotLastFeature || _inLastFeature || _afterLastFeatureErrorAdded)
				return;

			TokenNodeType tokenType = element.GetTokenType();
			if (tokenType != null && tokenType.IsWhitespace)
				return;

			// highlight from just after the last feature to the end of the document
			DocumentRange range = element.GetHighlightingRange().SetEndTo(File.GetDocumentRange().TextRange.EndOffset);
			AddHighlighting(new HighlightingInfo(range, new AfterLastFeatureHighlighting(element)));
			_afterLastFeatureErrorAdded = true;
		}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:50,代码来源:T4ErrorProcess.cs

示例3: IsFilteredNode

 /// <summary>
 /// Determines whether a given node is filtered.
 /// </summary>
 /// <param name="node">The node to check.</param>
 /// <returns><c>true</c> if <paramref name="node"/> is a whitespace; otherwise, <c>false</c>.</returns>
 public override bool IsFilteredNode(ITreeNode node)
 {
     TokenNodeType nodeType = node.GetTokenType();
     return nodeType != null && nodeType.IsWhitespace;
 }
开发者ID:ThatShawGuy,项目名称:ForTea,代码行数:10,代码来源:T4LanguageService.v7.cs


注:本文中的ITreeNode.GetTokenType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。