當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。