1 / 6

Code Regions and XML Comments

Code Regions and XML Comments. Code Regions. The code editor automatically puts little minus signs next to the header line for each Sub or Function. You can collapse these procedures to just their headers simply by clicking the minus sign.

Download Presentation

Code Regions and XML Comments

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Code Regions and XML Comments

  2. Code Regions • The code editor automatically puts little minus signs next to the header line for each Sub or Function. • You can collapse these procedures to just their headers simply by clicking the minus sign. • You can see this code again by clicking the plus signs.

  3. Code Regions • This is useful when you want to focus on two procedures that work together, but are separated by other procedures in your code. • By shrinking the unaffected procedures, you can compare the ones that you are working on with little or no scrolling.

  4. Creating Your Own Regions • You can add your own regions using the “#Region” directive. For example, if you wanted to identify Tom’s code for assignment 4, you could place a • #Region “Tom’s Code” • At the start, and an • #End Region • At the end of Tom’s code.

  5. Code Regions You can add a comment onto the #End Region so that is easier to identify your regions: #End Region ‘ Tom’s Code

  6. XML Comments • XML comments are typed in the line just above a class, procedure, property, or other declaration in your code. • XML comments are not as easy to read as regular comments, but they are more useful because Visual Studio incorporates them into Intellisense. • If you want to provide the users of your classes with the same type of on-the-spot help with your classes and procedures that VB does with the built-in classes, use XML comments. • To create XML comments for a code block, simply type three single quotes (‘’’) in the line above the declaration and hit Enter. • Visual Studio will fill in the framework for the comment. Simply type in the appropriate descriptions that you want the users of your code (which will probably include you) to see.

More Related