locked
find out the last element in the codefunction RRS feed

  • Question

  • hi:

    I try to use codelement to find out the last element of the codefunction. the main 

    goal of this is to insert an comment after the last statement  of the function, such like 

    public int test(){ int k;

    return 0; }

    a comment or instruction can be added  under the line int k;

    I have tried codefunction.children to find out the int k, however, it seems not work.

    is there any other method to get that, thanks.

     

    Wednesday, May 16, 2012 2:11 AM

Answers

  • Hi clementcw,

    You can try to use the CodeFunction.EndPoint Property, we can use this property to get the text point that is the location of the end of the code item.

    More information: http://msdn.microsoft.com/en-us/library/envdte.codefunction.endpoint(v=vs.100).aspx


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by lucy-liu Wednesday, May 23, 2012 7:04 AM
    Thursday, May 17, 2012 5:45 AM

All replies

  • Hi clementcw,

    You can try to use the CodeFunction.EndPoint Property, we can use this property to get the text point that is the location of the end of the code item.

    More information: http://msdn.microsoft.com/en-us/library/envdte.codefunction.endpoint(v=vs.100).aspx


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by lucy-liu Wednesday, May 23, 2012 7:04 AM
    Thursday, May 17, 2012 5:45 AM
  • Thanks.
    Friday, May 18, 2012 6:16 AM