Allow ToDump to set class name when output is ExpandoObject

I'm adding using an ExpandoObject in a private ToDump override to put out an object with variable properties. The output table in the result window shows this as an 'ExandoObject', which of course it is, but is there an easy way to have the table name describe the original class name instead?



  • Hmm...having trouble with the image link so here's the class in question:

    public class StyleInfo
    public StyleInfo(Visio.Shape vShp)
    ShpIn = vShp;

    private Visio.Shape ShpIn { get; }

    public string Name => $"{ShpIn.NameID} / {ShpIn.Name}";
    public string Style => ShpIn.Style;
    public string LineStyle => ShpIn.LineStyle;
    public string FillStyle => ShpIn.FillStyle;
    public string TextStyle => ShpIn.TextStyle;

    object ToDump()
    dynamic output = new ExpandoObject();
    output.Name = Name;
    output.Style = Style;
    if (LineStyle != Style)
    output.LineStyle = LineStyle;
    if (FillStyle != Style)
    output.FillStyle = FillStyle;
    if (TextStyle != Style)
    output.TextStyle = TextStyle;
    return output;
  • Thanks for the repro. I'll fix this for the next build.
  • That's great. Thanks very much Joe.
  • Thanks again. Confirm all fixed in 5.28 and header now reports original type name.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!