0
我有一個枚舉:狀態映射/枚舉映射
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;
哪有我創建一個這樣的映射,這兩個方向的作品?