How to use #region directive
Using #region directive
The #region
and #endregion
directives define a
region that will be expanded or collapsed when using
outlining in the Visual Studio IDE.
Syntax
The general form is shown here:
#region region-name
// code sequence
#endregion
Example
The following code shows how to use #region
and #endregion
.
using System;/* ww w . j av a 2 s . com*/
class MainClass
{
[STAThread]
static void Main(string[] args)
{
#region Stuff
#endregion
}
}
The code above generates the following result.