Pre-Processor VisualDirectives
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:Tutorials |
| C# Tutorials |
C# Preprocessor Directives
|
| edit |
Contents |
[edit]
Usage
The visual Pre-Processor Directive Commands #region and #endregion are probably the most used commands of the lot. The reason for this is that they allow for customized code folding.
[edit]
Example
Take for example the following class, notice on the left hand side the '+' symbols showing the automatic code folding areas. Note that this is optional and may be disabled in MS Visual Studio.
Although this isn't a huge amount of code it does lend itself to regions under particular headings.
Once the regions have been created they can be collapsed just like any of the automatic code folding areas
[edit]


