Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio/C# code similar to #pragma mark in Xcode

Is there a code snippet in Visual Studio/C# similar to Xcode's #pragma mark directive?

E.g. When setting #pragma mark Some Part Of Code in Xcode, "Some Part Of Code" appears in bold in the method enumeration drop-down list, thus you can use it for grouping methods according to their functionality and finding them easier later when needed.

like image 865
Alex Avatar asked Jan 06 '12 13:01

Alex


2 Answers

I think you're looking for #region?

Else, C# has #pragma too, but from your description it sounds like you want region

like image 101
Ron Sijm Avatar answered Sep 18 '22 05:09

Ron Sijm


If you are working in C# with Xamarin Studio,

Go To:

Xamarin preferences --> Text editor --> General --> Then Enable Code folding

Then you can use,

#region SomeRegion

//...Group of code...

#endregion            // end of MyRegion
like image 33
7vikram7 Avatar answered Sep 19 '22 05:09

7vikram7