[C#] Folding code

fold code

The preprocessing instructions provided by the editor are only useful when editing. When we publish the code or execute the code, the folding will automatically cancel the
composition: #region and #endregion are paired with
the main function : in our programming process, Fold the code wrapped in the middle to avoid the code being too messy and make the logic clearer.
How to use:

  1. Enter #region
  2. press enter
  3. press tab
  4. Change the folded code name (describes what the middle wrapped code is for)
  5. Enter the content you want to fold between #region and #endregion
  6. Click the minus sign on the left to collapse that section
    insert image description here
  7. Click the plus sign on the left to expand the collapsed content
    insert image description here

Code example:

            #region 变量
            //折叠代码
            //如何申明变量
            // 为什么要有那么多不同类型的变量
            //多个相同类型的变量 同时申明
            //变量初始化
            #endregion

Guess you like

Origin blog.csdn.net/weixin_64072619/article/details/131318566