public class State<T>
{
private T _value;
public T Value
{
get { return _value; }
set
{
_value = value;
}
}
//隐式转换
public static implicit operator State<T>(T input)
{
return new State<T>() { _value = input };
}
public override string ToString()
{
return _value.ToString();
}
//显式转换
//public static explicit operator State<T>(T input)
//{
// return new State<T>() { _value = input };
//}
}
public State<int> Count2 { get; set; } = 1;