This project has moved. For the latest updates, please go here.

Nested Types in TOC

Topics: Developer Forum
Dec 24, 2008 at 5:19 PM

We're having a problem where SHFB doesn't seem to be recognizing our Nested Types.

namespace Co.App.Geometry
    public sealed class CoordinateSystem
        public static class ProjectedCoordinateSystems
            public static class World
                public static Co.App.Geometry.CoordinateSystem Mercator { get {}}

Using VS2005, in the TOC we get:

+CoordinateSystem Class
CoordinateSystem.ProjectedCoordinateSystems Class
+CoordinateSystem.ProjectedCoordinateSystems.World Class
--+CoordinateSystem.ProjectedCoordinateSystems.World Properties
-----Mercator Property

And we expected:

+CoordinateSystem Class
+CoordinateSystem.ProjectedCoordinateSystems Class
--+CoordinateSystem.ProjectedCoordinateSystems.World Class
-----+CoordinateSystem.ProjectedCoordinateSystems.World Properties
--------Mercator Property

We can manually change the TOC around, that's not a problem, but we're just curious as to what may be going on? Does SHFB not recognize nested types? Or is there an adjustment we need to make to how we created them?

Additionally, the CoordinateSystem.ProjectedCoordinateSystems.World Members page is pulling a summary from the ProjectedCoordinateSystems class even though we have a summary for that class.

Any help is much appreciated.



Dec 24, 2008 at 7:09 PM
The layout of the TOC for the reference content is controlled by the Sandcastle transformations, not SHFB.  All three styles list nested classes at the root level following their parent class rather than nesting them.  This is most likely due to Microsoft's preference of listing them that way (see System.Windows.Forms.ComboBox and its nested classes on MSDN for example).  You could write a plug-in for SHFB to rearrange the intermediate TOC file generated by Sandcastle.  The HierarchicalTocPlugIn does that to nest the namespaces so it could be used as a model or perhaps extended to support nesting types too.  I'll make a note to look into it, but it may be a while before I can get to it.

Regarding the summary comments, that is most likely a bug in the Sandcastle transformations.  If you can put together a small example that reproduces the problem, you can post it either at the Sandcastle Styles project site and/or the Sandcastle project site.  If you post it at Sandcastle Styles and we can come up with a fix, we'll attach it to the work item and include it in a future patch release.