C# 枚举转集合

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/SANYUNI/article/details/51577247

枚举转成对应的集合

  public enum TestType
    {
        Binary,   
        Text  
    }

  public List<TestType> ProtocalTypes {
            get { return Enum.GetValues(typeof(TestType)).Cast<TestType>().ToList(); }
        }

猜你喜欢

转载自blog.csdn.net/SANYUNI/article/details/51577247
今日推荐