简体   繁体   中英

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?

Eg 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.

I think you're looking for #region ?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM