Partager via


#region (Visual J#) 

Enables you to specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Code Editor.

#region name

Parameters

  • name
    The name you want to give to the region, which will appear in the Visual Studio Code Editor.

Remarks

A #region block must be terminated with a #endregion (Visual J#) directive.

A #region block cannot overlap a #if block. However, a #region block can be nested in a #if block, and a #if block can be nested in a #region block.

The Visual J# compiler treats a line starting with #region or #endregion as a comment, so these directives are ignored in command-line builds.

Example

// preprocessor_region.jsl
#region MyClass definition
public class MyClass 
{
   public static void main(String [] args) 
   {
   }
}
#endregion

See Also

Reference

Visual J# Preprocessing Directives