Generic classes in TOC

Topics: Developer Forum, User Forum
Jun 24, 2008 at 11:55 PM
Hi,

First, many thanks for an excellent tool. I'm using SHFB 1.7.0.0 to produce reference documentation using the CSharp language filter and the VS2005 presentation style.

Here's my question: In the TOC, I've noticed that generic classes appear as follows:

   MyClass(T)

However, because I've selected C# as the language, I would expect them to appear with angle brackets instead of the parentheses:

   MyClass<T>

The correct (C#-style) brackets appear as expected in all of the generated topics. 

Is this intentional behavior? Is it something I can change? (I've noticed this behavior for at least 2 releases of Sandcastle...has there already been a topic on this that I missed?)

Thank you,
Sue
Coordinator
Jun 25, 2008 at 3:00 PM

I don't think you can change the titles in the TOC without changing the Sandcastle transformations.  The TOC titles usually come from the page titles so you'll see the same naming style in them too.  As I recall, Microsoft chose to display names in the TOC and page titles that way as a means of trying to be more language neutral. That's why it only lists the parameter names rather than including the parameters types too since listing types would require picking a language style.  In the VS2005 style and Hana too (I think), changing the language filter to one specific language does have an effect on some stuff in the page such as keyword declarations within summary and remarks text.  When only one is chosen, you see generics and arrays listed in that language's style.  When more than one is chosen, it falls back to a more VB-like style to cover all of them.  Syntax sections always show the items using the proper syntax for the language.

Eric

 

Jun 25, 2008 at 5:31 PM

Thanks for your reply.

I, too, would expect the TOC titles to match the page titles, as you suggest, but what I see is VB-like parentheses being used in the TOC and C#-like brackets being used on the corresponding page:

  • Map(T) -- entry in the TOC
  • Map<T> -- title of the corresponding page, used in the syntax section, etc.

The preference would be to use the C# style everywhere. Oh, well, I'll just tell the people reviewing my docs that this is intentional behavior!

Thanks again,
Sue


EWoodruff wrote:

I don't think you can change the titles in the TOC without changing the Sandcastle transformations.  The TOC titles usually come from the page titles so you'll see the same naming style in them too.  As I recall, Microsoft chose to display names in the TOC and page titles that way as a means of trying to be more language neutral. That's why it only lists the parameter names rather than including the parameters types too since listing types would require picking a language style.  In the VS2005 style and Hana too (I think), changing the language filter to one specific language does have an effect on some stuff in the page such as keyword declarations within summary and remarks text.  When only one is chosen, you see generics and arrays listed in that language's style.  When more than one is chosen, it falls back to a more VB-like style to cover all of them.  Syntax sections always show the items using the proper syntax for the language.

Eric