So, say I have 2 classes, C and B where they have a composition relationship, C is composed of B.
struct C
{
};
struct B
{
C c;
};
Now, I have a natvis file that has 2 views of C. Must I explicitly propagate this view from B to C? This sounds like a lot of hassle since the natvis file doesn't state the types that are being displayed resulting in missing locations where I want that view propagated. Also, this wouldn't work for containers. I would only have a view for an individual item.
EDIT:
Example:
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="C">
<DisplayString>View 1</DisplayString>
</Type>
<Type Name="C" IncludeView="two">
<DisplayString>View 2</DisplayString>
</Type>
<Type Name="B">
<DisplayString>B</DisplayString>
<Expand>
<Item Name="C">c</Item>
</Expand>
</Type>
</AutoVisualizer>
Now in the watch window I look at a variable b
which is of type B
. To see it, I type:
b, view(two)
To which I would expect the view to propagate to the view of c
. But it doesn't. It would instead show:
c View 1
Without having to write:
<Type Name="B">
<DisplayString>B</DisplayString>
<Expand>
<Item Name="C" ExcludeView="two">c</Item>
<Item Name="C" IncludeView="two">c</Item>
</Expand>
</Type>
How would I accomplish this?