SubMain - CodeIt.Right The First Time!

/Community

Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials/CIR Tutorials/GD Downloads
Welcome to SubMain Community Sign in | Join | Help

Using <see cref=""/> in parameter documentation.

Last post 01-05-2018, 7:12 AM by MorganVergara. 2 replies.
Sort Posts: Previous Next
  •  01-04-2018, 1:11 PM 5059

    Using <see cref=""/> in parameter documentation.

    I have a method with the following signature:

    public T Get<T>(ApiConnectInfo apiConnectInfo) 

    I'm trying to format the parameter documentation as follows: 

    /// <param name="apiConnectInfo"><see cref="ApiConnectInfo" /> containing the API connect information.</param>

    I've tried the following and it's almost right. 

    this.Write(Context.ExecMacro(parameter.Name, "$(TypeName.FullNameAsSee)") + " containing " + Context.ExecMacro(parameter.Name, "$(OfTheReordering)"));

    This results in:

    /// <param name="apiConnectInfo"><see cref="apiConnectInfo"/> The API connect information</param>

    It appears to be using the parameter name for the <see> tag instead of the parameter type, and  the "The" should be lower cased.

    Any thoughts?

    Also, this would be a nice to have, but is there a way to put an A/An before the <see> tag and have it properly determine if it starts with a vowel and use the right article?

     Thanks much,

    Morgan 

     

  •  01-05-2018, 2:59 AM 5060 in reply to 5059

    Re: Using <see cref=""/> in parameter documentation.

    Hi Morgan,

    Please use the following code:

    bool isVowel = "aeiouAEIOU".IndexOf(parameter.ReturnType.FullName[0]) >= 0;
    this.Write(((isVowel) ? "An " : "A ") + Context.ExecMacro(parameter.ReturnType.FullName, "$(TypeName.FullNameAsSee)") + " containing the " + Context.ExecMacro(parameter.Name, "$(All)") + ".");
     


    Thank you,
    Misha Zhutov
    http://submain.com - .NET Developer Tools | Microsoft VB MVP
  •  01-05-2018, 7:12 AM 5061 in reply to 5060

    Re: Using <see cref=""/> in parameter documentation.

    Awesome!  Thanks.  
View as RSS news feed in XML
 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |