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


C# Language.TypeToString方法代码示例

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


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

示例1: Write

		public static ITextOutput Write(ITextOutput output, MethodDef method, Language language) {
			output.Write(UIUtils.CleanUpIdentifier(method.Name), TextTokenHelper.GetTextTokenType(method));
			output.Write('(', TextTokenType.Operator);
			for (int i = 0; i < method.Parameters.Count; i++) {
				if (method.Parameters[i].IsHiddenThisParameter)
					continue;
				if (method.Parameters[i].MethodSigIndex > 0) {
					output.Write(',', TextTokenType.Operator);
					output.WriteSpace();
				}
				language.TypeToString(output, method.Parameters[i].Type.ToTypeDefOrRef(), false, method.Parameters[i].ParamDef);
			}
			if (method.CallingConvention == CallingConvention.VarArg || method.CallingConvention == CallingConvention.NativeVarArg) {
				if (method.MethodSig.GetParamCount() > 0) {
					output.Write(',', TextTokenType.Operator);
					output.WriteSpace();
				}
				output.Write("...", TextTokenType.Operator);
			}
			output.Write(')', TextTokenType.Operator);
			output.WriteSpace();
			output.Write(':', TextTokenType.Operator);
			output.WriteSpace();
			language.TypeToString(output, method.ReturnType.ToTypeDefOrRef(), false, method.Parameters.ReturnParameter.ParamDef);
			method.MDToken.WriteSuffixString(output);
			return output;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:27,代码来源:MethodTreeNode.cs

示例2: GetText

		public static object GetText(MethodDefinition method, Language language)
		{
			StringBuilder b = new StringBuilder();
			b.Append('(');
			for (int i = 0; i < method.Parameters.Count; i++) {
				if (i > 0)
					b.Append(", ");
				b.Append(language.TypeToString(method.Parameters[i].ParameterType, false, method.Parameters[i]));
			}
			b.Append(") : ");
			b.Append(language.TypeToString(method.ReturnType, false, method.MethodReturnType));
			return HighlightSearchMatch(method.Name, b.ToString());
		}
开发者ID:tanujmathur,项目名称:ILSpy,代码行数:13,代码来源:MethodTreeNode.cs

示例3: Write

		public static ITextOutput Write(ITextOutput output, EventDef ev, Language language) {
			output.Write(UIUtils.CleanUpIdentifier(ev.Name), TextTokenHelper.GetTextTokenType(ev));
			output.WriteSpace();
			output.Write(':', TextTokenType.Operator);
			output.WriteSpace();
			language.TypeToString(output, ev.EventType, false, ev);
			ev.MDToken.WriteSuffixString(output);
			return output;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:EventTreeNode.cs

示例4: Write

		public static ITextOutput Write(ITextOutput output, PropertyDef property, Language language, bool? isIndexer = null) {
			language.FormatPropertyName(output, property, isIndexer);
			output.WriteSpace();
			output.Write(':', TextTokenType.Operator);
			output.WriteSpace();
			language.TypeToString(output, property.PropertySig.GetRetType().ToTypeDefOrRef(), false, property);
			property.MDToken.WriteSuffixString(output);
			return output;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:PropertyTreeNode.cs

示例5: Write

		public static ITextOutput Write(ITextOutput output, FieldDef field, Language language) {
			output.Write(UIUtils.CleanUpIdentifier(field.Name), TextTokenHelper.GetTextTokenType(field));
			output.WriteSpace();
			output.Write(':', TextTokenType.Operator);
			output.WriteSpace();
			language.TypeToString(output, field.FieldType.ToTypeDefOrRef(), false, field);
			field.MDToken.WriteSuffixString(output);
			return output;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:FieldTreeNode.cs

示例6: GetText

		public static object GetText(MethodDefinition method, Language language)
		{
			StringBuilder b = new StringBuilder();
			b.Append('(');
			for (int i = 0; i < method.Parameters.Count; i++) {
				if (i > 0)
					b.Append(", ");
				b.Append(language.TypeToString(method.Parameters[i].ParameterType, false, method.Parameters[i]));
			}
			if (method.CallingConvention == MethodCallingConvention.VarArg) {
				if (method.HasParameters)
					b.Append(", ");
				b.Append("...");
			}
			b.Append(") : ");
			b.Append(language.TypeToString(method.ReturnType, false, method.MethodReturnType));
			b.Append(method.MetadataToken.ToSuffixString());
			return HighlightSearchMatch(method.Name, b.ToString());
		}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:19,代码来源:MethodTreeNode.cs

示例7: GetText

		public static object GetText(MethodDefinition method, Language language)
		{
			StringBuilder b = new StringBuilder();
			b.Append('(');
			for (int i = 0; i < method.Parameters.Count; i++) {
				if (i > 0)
					b.Append(", ");
                var parameterType = language.TypeToString(method.Parameters[i].ParameterType, false, method.Parameters[i]);
                b.Append(UnicodeSupport.FormatUnicodeIdentifier(parameterType));
			}
			if (method.CallingConvention == MethodCallingConvention.VarArg) {
				if (method.HasParameters)
					b.Append(", ");
				b.Append("...");
			}
			b.Append(") : ");
            var returnType = language.TypeToString(method.ReturnType, false, method.MethodReturnType);
			b.Append(UnicodeSupport.FormatUnicodeIdentifier(returnType));
			return HighlightSearchMatch(UnicodeSupport.FormatUnicodeIdentifier(method.Name), b.ToString());
		}
开发者ID:x-strong,项目名称:ILSpy,代码行数:20,代码来源:MethodTreeNode.cs

示例8: Write

		public static ITextOutput Write(ITextOutput output, ITypeDefOrRef tr, Language language)
		{
			language.TypeToString(output, tr, true);
			tr.MDToken.WriteSuffixString(output);
			return output;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:6,代码来源:BaseTypesEntryNode.cs

示例9: GetText

		public static object GetText(PropertyDefinition property, Language language, bool? isIndexer = null)
		{
			return HighlightSearchMatch(language.FormatPropertyName(property, isIndexer), " : " + language.TypeToString(property.PropertyType, false, property));
		}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:4,代码来源:PropertyTreeNode.cs

示例10: GetText

        public static object GetText(PropertyDefinition property, Language language, bool? isIndexer = null)
        {
            string name = language.FormatPropertyName(property, isIndexer);

            var b = new System.Text.StringBuilder();
            if (property.HasParameters)
            {
                b.Append('(');
                for (int i = 0; i < property.Parameters.Count; i++)
                {
                    if (i > 0)
                        b.Append(", ");
                    b.Append(language.TypeToString(property.Parameters[i].ParameterType, false, property.Parameters[i]));
                }
                var method = property.GetMethod ?? property.SetMethod;
                if (method.CallingConvention == MethodCallingConvention.VarArg)
                {
                    if (property.HasParameters)
                        b.Append(", ");
                    b.Append("...");
                }
                b.Append(") : ");
            }
            else
            {
                b.Append(" : ");
            }
            b.Append(language.TypeToString(property.PropertyType, false, property));
            b.Append(property.MetadataToken.ToSuffixString());

            return HighlightSearchMatch(name, b.ToString());
        }
开发者ID:Zvirja,项目名称:ILSpy,代码行数:32,代码来源:PropertyTreeNode.cs

示例11: GetText

 public static object GetText(EventDef eventDef, Language language)
 {
     return HighlightSearchMatch(eventDef.Name, " : " + language.TypeToString(eventDef.EventType.ToTypeSig().ResolveGenericParams(eventDef.DeclaringType).ToTypeDefOrRef(), false, eventDef));
 }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:4,代码来源:EventTreeNode.cs

示例12: GetText

		public static object GetText(EventDefinition eventDef, Language language)
		{
			return HighlightSearchMatch(eventDef.Name, " : " + language.TypeToString(eventDef.EventType, false, eventDef));
		}
开发者ID:rmattuschka,项目名称:ILSpy,代码行数:4,代码来源:EventTreeNode.cs

示例13: GetText

 public static object GetText(MethodDef method, Language language)
 {
     StringBuilder b = new StringBuilder();
     b.Append('(');
     for (int i = 0; i < method.Parameters.Count; i++) {
         if (method.Parameters[i].IsHiddenThisParameter)
             continue;
         if (method.Parameters[i].MethodSigIndex > 0)
             b.Append(", ");
         b.Append(language.TypeToString(method.Parameters[i].Type.ResolveGenericParams(method).ToTypeDefOrRef(), false, method.Parameters[i].ParamDef));
     }
     if (method.CallingConvention == CallingConvention.VarArg) {
         if (method.MethodSig.Params.Count > 0)
             b.Append(", ");
         b.Append("...");
     }
     b.Append(") : ");
     b.Append(language.TypeToString(method.ReturnType.ResolveGenericParams(method).ToTypeDefOrRef(), false, method.Parameters.ReturnParameter.ParamDef));
     return HighlightSearchMatch(method.Name, b.ToString());
 }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:20,代码来源:MethodTreeNode.cs

示例14: GetText

 public static object GetText(PropertyDef property, Language language, bool? isIndexer = null)
 {
     return HighlightSearchMatch(language.FormatPropertyName(property, isIndexer), " : " + language.TypeToString(property.PropertySig.RetType.ResolveGenericParams(property.DeclaringType).ToTypeDefOrRef(), false, property));
 }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:4,代码来源:PropertyTreeNode.cs

示例15: Decompile

		public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
		{
			language.WriteCommentLine(output, language.TypeToString(def, true));
		}
开发者ID:arturek,项目名称:ILSpy,代码行数:4,代码来源:DerivedTypesTreeNode.cs


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