Esempio n. 1
0
        protected override void FormatReturnValueMethodName(DbgEvaluationInfo evalInfo, IDbgTextWriter output, DbgValueFormatterTypeOptions typeOptions, DbgValueFormatterOptions valueOptions, CultureInfo?cultureInfo, DmdMethodBase method, DmdPropertyInfo?property)
        {
            var typeFormatter = new Formatters.VisualBasic.VisualBasicTypeFormatter(output, typeOptions.ToTypeFormatterOptions(), null);

            typeFormatter.Format(method.DeclaringType !, null);
            var valueFormatter = new Formatters.VisualBasic.VisualBasicPrimitiveValueFormatter(output, valueOptions.ToValueFormatterOptions(), cultureInfo);

            output.Write(DbgTextColor.Operator, ".");
            if (property is not null)
            {
                output.Write(MemberUtils.GetColor(property), Formatters.VisualBasic.VisualBasicTypeFormatter.GetFormattedIdentifier(property.Name));
                valueFormatter.WriteTokenComment(property.MetadataToken);
                output.Write(DbgTextColor.Operator, ".");
                output.Write(DbgTextColor.Keyword, "Get");
                valueFormatter.WriteTokenComment(method.MetadataToken);
            }
            else
            {
                var operatorInfo = Formatters.VisualBasic.Operators.TryGetOperatorInfo(method.Name);
                if (operatorInfo is not null && method is DmdMethodInfo methodInfo)
                {
                    for (int i = 0; i < operatorInfo.Length; i++)
                    {
                        if (i > 0)
                        {
                            output.Write(DbgTextColor.Text, " ");
                        }
                        var s = operatorInfo[i];
                        output.Write('A' <= s[0] && s[0] <= 'Z' ? DbgTextColor.Keyword : DbgTextColor.Operator, s);
                    }
                    WriteGenericMethodArguments(output, method, typeFormatter);
                }
        protected override void FormatReturnValueMethodName(DbgEvaluationInfo evalInfo, IDbgTextWriter output, DbgValueFormatterTypeOptions typeOptions, DbgValueFormatterOptions valueOptions, CultureInfo?cultureInfo, DmdMethodBase method, DmdPropertyInfo?property)
        {
            var typeFormatter = new Formatters.VisualBasic.VisualBasicTypeFormatter(output, typeOptions.ToTypeFormatterOptions(), null);

            typeFormatter.Format(method.DeclaringType !, null);
            var valueFormatter = new Formatters.VisualBasic.VisualBasicPrimitiveValueFormatter(output, valueOptions.ToValueFormatterOptions(), cultureInfo);

            output.Write(DbgTextColor.Operator, ".");
            if (!(property is null))
            {
                output.Write(MemberUtils.GetColor(property), Formatters.VisualBasic.VisualBasicTypeFormatter.GetFormattedIdentifier(property.Name));
                valueFormatter.WriteTokenComment(property.MetadataToken);
                output.Write(DbgTextColor.Operator, ".");
                output.Write(DbgTextColor.Keyword, "Get");
                valueFormatter.WriteTokenComment(method.MetadataToken);
            }