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


C# ITreeNode.GetHighlightingRange方法代码示例

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


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

示例1: 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) {
			string attributeId = GetHighlightingAttributeId(element);
			if (attributeId != null) {
				DocumentRange range = element.GetHighlightingRange();
				AddHighlighting(new HighlightingInfo(range, new PredefinedHighlighting(attributeId, range)));
			}
		}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:11,代码来源:T4HighlightingProcess.cs

示例2: VisitNode

		public override void VisitNode(ITreeNode node, IHighlightingConsumer context) {
			base.VisitNode(node, context);
			
			DocumentRange highlightingRange = node.GetHighlightingRange();
			//context.AddHighlighting(new PredefinedHighlighting(VsPredefinedHighlighterIds.RazorCode), highlightingRange);

			string attributeId = GetHighlightingAttributeId(node);
			if (attributeId != null)
				context.AddHighlighting(new PredefinedHighlighting(attributeId, highlightingRange));
		}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:10,代码来源:T4CSharpHighlightingProcess.cs

示例3: 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

示例4: VisitNode

 public override void VisitNode(ITreeNode node, IHighlightingConsumer context)
 {
     base.VisitNode(node, context);
     string attributeId = GetHighlightingAttributeId(node);
     if (attributeId != null)
         context.AddHighlighting(new PredefinedHighlighting(attributeId), node.GetHighlightingRange());
 }
开发者ID:sscctech,项目名称:ForTea,代码行数:7,代码来源:T4CSharpHighlightingProcess.cs


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