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


C# Identifier.AnnotationVT方法代码示例

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


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

示例1: WriteIdentifier

		public override void WriteIdentifier(Identifier identifier, TextTokenType tokenType)
		{
			if (tokenType == TextTokenType.Text)
				tokenType = TextTokenHelper.GetTextTokenType(identifier.AnnotationVT<TextTokenType>() ?? identifier.Annotation<object>());

			if (tokenType != TextTokenType.Keyword && (identifier.IsVerbatim || CSharpOutputVisitor.IsKeyword(identifier.Name, identifier))) {
				output.Write('@', TextTokenType.Operator);
			}
			
			var definition = GetCurrentDefinition(identifier);
			if (definition != null) {
				output.WriteDefinition(IdentifierEscaper.Escape(identifier.Name), definition, tokenType, false);
				return;
			}
			
			object memberRef = GetCurrentMemberReference();

			if (memberRef != null) {
				output.WriteReference(IdentifierEscaper.Escape(identifier.Name), memberRef, tokenType);
				return;
			}

			definition = GetCurrentLocalDefinition();
			if (definition != null) {
				output.WriteDefinition(IdentifierEscaper.Escape(identifier.Name), definition, tokenType);
				return;
			}

			memberRef = GetCurrentLocalReference();
			if (memberRef != null) {
				output.WriteReference(IdentifierEscaper.Escape(identifier.Name), memberRef, tokenType, true);
				return;
			}

			if (firstUsingDeclaration) {
				output.MarkFoldStart(defaultCollapsed: true);
				firstUsingDeclaration = false;
			}

			var s = identifier.Name;
			if (identifier.Annotation<IdentifierFormatted>() == null)
				s = IdentifierEscaper.Escape(s);
			output.Write(s, tokenType);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:44,代码来源:TextTokenWriter.cs

示例2: WriteIdentifier

		public override void WriteIdentifier(Identifier identifier, TextTokenKind tokenKind)
		{
			if (tokenKind == TextTokenKind.Text)
				tokenKind = TextTokenKindUtils.GetTextTokenType(identifier.AnnotationVT<TextTokenKind>() ?? identifier.Annotation<object>());

			if (tokenKind != TextTokenKind.Keyword && (identifier.IsVerbatim || CSharpOutputVisitor.IsKeyword(identifier.Name, identifier))) {
				output.Write("@", TextTokenKind.Operator);
			}
			
			var definition = GetCurrentDefinition(identifier);
			if (definition != null) {
				output.WriteDefinition(IdentifierEscaper.Escape(identifier.Name), definition, tokenKind, false);
				return;
			}
			
			object memberRef = GetCurrentMemberReference();

			if (memberRef != null) {
				output.WriteReference(IdentifierEscaper.Escape(identifier.Name), memberRef, tokenKind);
				return;
			}

			definition = GetCurrentLocalDefinition();
			if (definition != null) {
				output.WriteDefinition(IdentifierEscaper.Escape(identifier.Name), definition, tokenKind);
				return;
			}

			memberRef = GetCurrentLocalReference();
			if (memberRef != null) {
				output.WriteReference(IdentifierEscaper.Escape(identifier.Name), memberRef, tokenKind, true);
				return;
			}

			if (firstUsingDeclaration) {
				firstUsingDeclaration = false;
			}

			var s = identifier.Name;
			if (identifier.Annotation<IdentifierFormatted>() == null)
				s = IdentifierEscaper.Escape(s);
			output.Write(s, tokenKind);
		}
开发者ID:levisre,项目名称:dnSpy,代码行数:43,代码来源:TextTokenWriter.cs

示例3: WriteIdentifier

		public override void WriteIdentifier(Identifier identifier, TextTokenType tokenType)
		{
			if (tokenType == TextTokenType.Text)
				tokenType = TextTokenHelper.GetTextTokenType(identifier.AnnotationVT<TextTokenType>() ?? identifier.Annotation<object>());

			var definition = GetCurrentDefinition(identifier);
			if (definition != null) {
				output.WriteDefinition(IdentifierEscaper.Escape(identifier.Name), definition, tokenType, false);
				return;
			}
			
			object memberRef = GetCurrentMemberReference();

			if (memberRef != null) {
				output.WriteReference(IdentifierEscaper.Escape(identifier.Name), memberRef, tokenType);
				return;
			}

			definition = GetCurrentLocalDefinition();
			if (definition != null) {
				output.WriteDefinition(IdentifierEscaper.Escape(identifier.Name), definition, tokenType);
				return;
			}

			memberRef = GetCurrentLocalReference();
			if (memberRef != null) {
				output.WriteReference(IdentifierEscaper.Escape(identifier.Name), memberRef, tokenType, true);
				return;
			}

			if (firstUsingDeclaration) {
				output.MarkFoldStart(defaultCollapsed: true);
				firstUsingDeclaration = false;
			}

			output.Write(IdentifierEscaper.Escape(identifier.Name), tokenType);
		}
开发者ID:lisong521,项目名称:dnSpy,代码行数:37,代码来源:TextTokenWriter.cs

示例4: WriteIdentifier

		protected virtual void WriteIdentifier(Identifier identifier)
		{
			WriteIdentifier(identifier, (identifier.AnnotationVT<TextColor>() ?? TextColor.Text).Box());
		}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:4,代码来源:CSharpOutputVisitor.cs

示例5: WriteIdentifier

		protected virtual void WriteIdentifier(Identifier identifier)
		{
			WriteIdentifier(identifier, identifier.AnnotationVT<TextTokenType>() ?? TextTokenType.Text);
		}
开发者ID:JackWangCUMT,项目名称:NRefactory,代码行数:4,代码来源:CSharpOutputVisitor.cs


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