我有一个枚举:
public enum Process
{
visiblestateA = 1,
visiblestateB = 2,
visiblestateC = 3,
visiblestateD = 4
...
}
此枚举是进程的可见状态。进程本身有 6 个子进程,有 6 个子进程状态
public enum Subprocess1
{
subprocess1stateA = 1,
subprocess1stateB = 2,
subprocess1stateC = 3,
subprocess1stateD = 4
...
}
public enum Subprocess2 { ... }
public enum Subprocess3 { ... }
public enum Subprocess4 { ... }
public enum Subprocess5 { ... }
public enum Subprocess6 { ... }
我正在寻找一种映射流程 <-> 子流程的好方法
这将是一个解决方案
if (_subprocess1 == Subprocess1.subprocess1stateA && _subprocess3 == Subprocess3.subprocess3stateD)
_process = Process.visiblestateA;
我如何创建这样的映射,这在两个方向上都有效?