Adding #region automatically and count region members on Visual Studio 2015

Answered

My team uses regions. We want to add regions to code automatically. we want define sections in code and determine the way members fields, methods, properties etc. should be placed inside them. we want have count of members of regions in parenthesis in name of region. Regionerate do this but it doesn't work on Visual Stuido 2015. any other way? (in Resharper or anything else)

    public class BankService : IBankService
    {
         #region Fields (7)
         //...
         #endregion Fields

         #region Constructors (1)
         //...
         #endregion Constructors

         #region Methods (6)
         //...
         #endregion Methods
    }

 

0
3 comments
Official comment

Hello Arman,

You may surround any code entities (like properties, fields, methods) with regions using File Layout https://www.jetbrains.com/resharper/help/File_and_Type_Layout.html.

As for counting a number of entities inside: ReSharper does not provide any similar features. 

Thanks! 

tnx to reply. 

ReSharper does not provide any similar features: can it be a feature in the future of Resharper?

 

0

Feel free to file a new feature request to https://youtrack.jetbrains.com/issues/RSRP

Thanks! 

0

Please sign in to leave a comment.