Define enums within a method in C#?

前端 未结 5 1972
囚心锁ツ
囚心锁ツ 2020-12-18 17:50

I have mainly a C++ background and I am learning C#. So, I need some help with C# idioms and style.

I am trying to write, in C#, a small text-file parsing method i

5条回答
  •  时光取名叫无心
    2020-12-18 18:27

    The closest you can get is a private nested enum with in the class:

    public class TheClass
    {
        private enum TheEnum 
        {
           stHeader, 
           stBody, 
           stFooter
        }
    
        // ...the rest of the methods properties etc... 
    }
    

提交回复
热议问题