请帮助我理解此代码。这就像对象而不是值的枚举吗?是否有解释此过程的术语或模式?
public class State
{
private State(String value)
{
Value = value;
}
public String Value { get; set; }
public static State Open => new State("Open");
public static State Closed => new State("Closed");
public static State YourOpen => new State("YourOpen");
public static State YourClosed => new State("YourClosed");
}
临摹微笑
哔哔one
神不在的星期二
相关分类