void Format(DmdMethodBase method, DmdPropertyInfo property, AccessorKind accessorKind) { if (ReturnTypes) { FormatReturnType(property.PropertyType, TypeFormatterUtils.IsReadOnlyProperty(property)); WriteSpace(); } if (DeclaringTypes) { FormatType(property.DeclaringType); WritePeriod(); } if (property.GetIndexParameters().Count != 0) { OutputWrite(Keyword_this, BoxedTextColor.Keyword); WriteToken(property); WriteMethodParameterListCore(method, GetAllMethodParameterTypes(property.GetMethodSignature()), IndexerParenOpen, IndexerParenClose, showParameterTypes: true, showParameterNames: false, showParameterValues: false); } else { WriteIdentifier(property.Name, TypeFormatterUtils.GetColor(property)); WriteToken(property); } WriteAccessor(accessorKind); WriteToken(method); WriteGenericArguments(method); WriteMethodParameterList(method, MethodParenOpen, MethodParenClose); WriteOffset(); }
protected override void FormatReturnValueMethodName(DbgEvaluationInfo evalInfo, IDbgTextWriter output, DbgValueFormatterTypeOptions typeOptions, DbgValueFormatterOptions valueOptions, CultureInfo cultureInfo, DmdMethodBase method, DmdPropertyInfo property) { var typeFormatter = new Formatters.CSharp.CSharpTypeFormatter(output, typeOptions.ToTypeFormatterOptions(), null); typeFormatter.Format(method.DeclaringType, null); var valueFormatter = new Formatters.CSharp.CSharpPrimitiveValueFormatter(output, valueOptions.ToValueFormatterOptions(), cultureInfo); output.Write(DbgTextColor.Operator, "."); if ((object)property != null) { if (property.GetIndexParameters().Count != 0) { output.Write(DbgTextColor.Keyword, Keyword_this); WriteMethodParameterList(output, method, typeFormatter, GetAllMethodParameterTypes(property.GetMethodSignature()), IndexerParenOpen, IndexerParenClose); } else { output.Write(MemberUtils.GetColor(property), Formatters.CSharp.CSharpTypeFormatter.GetFormattedIdentifier(property.Name)); } valueFormatter.WriteTokenComment(property.MetadataToken); output.Write(DbgTextColor.Operator, "."); output.Write(DbgTextColor.Keyword, "get"); valueFormatter.WriteTokenComment(method.MetadataToken); } else { var methodColor = TypeFormatterUtils.GetColor(method, canBeModule: false); if (TypeFormatterUtils.TryGetMethodName(method.Name, out var containingMethodName, out var localFunctionName)) { output.Write(methodColor, Formatters.CSharp.CSharpTypeFormatter.GetFormattedIdentifier(containingMethodName)); output.Write(DbgTextColor.Operator, "."); output.Write(methodColor, Formatters.CSharp.CSharpTypeFormatter.GetFormattedIdentifier(localFunctionName)); valueFormatter.WriteTokenComment(method.MetadataToken); WriteGenericMethodArguments(output, method, typeFormatter); }