Exemplo n.º 1
0
		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;
		}
Exemplo n.º 2
0
		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());
		}
Exemplo n.º 3
0
		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;
		}
Exemplo n.º 4
0
		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;
		}
Exemplo n.º 5
0
		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;
		}
Exemplo n.º 6
0
		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());
		}
Exemplo n.º 7
0
		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());
		}
Exemplo n.º 8
0
		public static ITextOutput Write(ITextOutput output, ITypeDefOrRef tr, Language language)
		{
			language.TypeToString(output, tr, true);
			tr.MDToken.WriteSuffixString(output);
			return output;
		}
Exemplo n.º 9
0
		public static object GetText(PropertyDefinition property, Language language, bool? isIndexer = null)
		{
			return HighlightSearchMatch(language.FormatPropertyName(property, isIndexer), " : " + language.TypeToString(property.PropertyType, false, property));
		}
Exemplo n.º 10
0
        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());
        }
Exemplo n.º 11
0
 public static object GetText(EventDef eventDef, Language language)
 {
     return HighlightSearchMatch(eventDef.Name, " : " + language.TypeToString(eventDef.EventType.ToTypeSig().ResolveGenericParams(eventDef.DeclaringType).ToTypeDefOrRef(), false, eventDef));
 }
Exemplo n.º 12
0
		public static object GetText(EventDefinition eventDef, Language language)
		{
			return HighlightSearchMatch(eventDef.Name, " : " + language.TypeToString(eventDef.EventType, false, eventDef));
		}
Exemplo n.º 13
0
 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());
 }
Exemplo n.º 14
0
 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));
 }
Exemplo n.º 15
0
		public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
		{
			language.WriteCommentLine(output, language.TypeToString(def, true));
		}
Exemplo n.º 16
0
		public static object GetText(EventDefinition eventDef, Language language)
		{
            var eventType = language.TypeToString(eventDef.EventType, false, eventDef);
			return HighlightSearchMatch(UnicodeSupport.FormatUnicodeIdentifier(eventDef.Name), " : " + UnicodeSupport.FormatUnicodeIdentifier(eventType));
		}
Exemplo n.º 17
0
		public static object GetText(PropertyDefinition property, Language language, bool? isIndexer = null)
		{
            var propertyName = language.FormatPropertyName(property, isIndexer);
            var propertyType = language.TypeToString(property.PropertyType, false, property);
            return HighlightSearchMatch(UnicodeSupport.FormatUnicodeIdentifier(propertyName), " : " + UnicodeSupport.FormatUnicodeIdentifier(propertyType));
		}