Any ideas? Create two different help files for one solution

Topics: Developer Forum, User Forum
Feb 1, 2012 at 6:52 PM

Hello fellow sandcastlers,

as it is common practice, we redirect access to message string resources via a mapping like

public static class ErrorMessages
{
    public static string UserIsNotAllowedToModifyThePolicySet = "POM12345";
}

What I'm trying to achieve would look like this (note that this example purposely uses two languages to further stress the idea):

public static class ErrorMessages
{
    /// <summary>
    /// A user tried to create a new policy set, but did not provide a unique name for it.
    /// </summary>
    /// <remarks>
    /// This is an error message.
    /// </remarks>
    /// <customerCareInfo>
    /// <code>POM12345</code>
    /// <translation>Ein Anwender hat versucht, einen Rechtesatz anzulegen, ohne f&uuml;r es einen (eindeutigen) Namen anzugeben.</translation>
    /// <cause>Ein Rechtesatz ben&ouml;tigt einen eindeutigen Namen.</cause>
    /// <relief>Geben Sie dem Rechtesatz einen eindeutigen Namen.</relief>
    /// </customerCareInfo>
    public static string UserTriedToCreateAPolicySetWithoutAUniqueName = "POM12345";
}

Since developers do not need the info provided in the customerCareInfo section, and since customer care would only be confused by the commentary provided for developers, I like to split both information into two help files. Customer care would be delighted by a help file with all these message numbers on the left (content tree), and the information provided within the customerCareInfo sections.

Is there an !!easy!! way to achieve this?

Thx and regards,

Carsten

Coordinator
Feb 1, 2012 at 8:55 PM

I think you could achieve this by creating a plug-in that runs after the comments files have been copied to the working directory to strip out one set of comments or the other based on the plug-in settings.  If you took advantage of custom project properties, you could probably make it configurable through that property so that you could pass it in on the command line etc. and get around having two projects with different settings although if you wanted to filter it down to just the messages for customer care, you'd probably need a separate project anyway with an API filter.  You'd would have to modify the Sandcastle XSL transformations to handle the additional custom elements either way.  That's just one idea.

Eric