0

In Visual Studio 2017. How can I achieve it?

   public class Test : IFace
{
    #region IFace implementation        

How can I add this #region when Auto-Generate?

    public void DoSomething()
    {
        //TODO...
    }
    #endregion
}
ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
H.h
  • 9
  • 2
  • See https://stackoverflow.com/questions/13567594/automatically-add-regions-to-code-in-visual-studio – Rahul Dec 13 '18 at 06:09
  • Auto generate what? – cdev Dec 13 '18 at 06:10
  • I think OP means when you write `public class Test: IFace` and then right-click `IFace` and select "Quick Actions and Refactorings > Implement Interface". That threw me too for a moment. – ProgrammingLlama Dec 13 '18 at 06:17
  • Yes,that's what i mean. "Quick Actions and Refactorings > Implement Interface" . Generate #region .......... #endregion. – H.h Dec 13 '18 at 07:21
  • See https://stackoverflow.com/questions/31551803/automatically-surround-generated-code-with-region-when-implementing-interfaces Looks like this particular option that enables you to achieve exactly what you want, was present as far as I remember in VS 2012 but it's gone since VS 2015 and, unfortunately, they haven't fixed it to this day. – Szybki May 06 '21 at 14:35

0 Answers0