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?
Comments
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;
}
}