本文整理汇总了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;
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}
示例8: Write
public static ITextOutput Write(ITextOutput output, ITypeDefOrRef tr, Language language)
{
language.TypeToString(output, tr, true);
tr.MDToken.WriteSuffixString(output);
return output;
}
示例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));
}
示例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());
}
示例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));
}
示例12: GetText
public static object GetText(EventDefinition eventDef, Language language)
{
return HighlightSearchMatch(eventDef.Name, " : " + language.TypeToString(eventDef.EventType, false, eventDef));
}
示例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());
}
示例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));
}
示例15: Decompile
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, language.TypeToString(def, true));
}