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(); }
public static bool IsMatch(DmdPropertyInfo property, IList <DmdType> types) => IsMatch(property.GetMethodSignature().GetParameterTypes(), types ?? Array.Empty <DmdType>());
public static DbgTextColor GetColor(DmdPropertyInfo property) { var methodSig = (property.GetGetMethod(DmdGetAccessorOptions.All) ?? property.GetSetMethod(DmdGetAccessorOptions.All))?.GetMethodSignature() ?? property.GetMethodSignature(); return(methodSig.HasThis ? DbgTextColor.InstanceProperty : DbgTextColor.StaticProperty); }
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); }