自定义结构体无法使用Foreach进行遍历,求解决方法,急。
public struct DoubleParam{
public string Name;
public double Value;
public bool HeartBeat;
public bool DataValid;
public DateTime DTime;
}
public struct ParamPool
{
public DoubleParam param1;
public DoubleParam param2;
public DoubleParam param3;
public DoubleParam param4;
public DoubleParam param5;
public DoubleParam param6;
public DoubleParam param7;
public DoubleParam param8;
}
public ParamPool InnerParam = new ParamPool();
public void ShowFun()
{
foreach(DoubleParam DP in InnnerParam)
{
// 此处使用Foreach时报错,求不大幅更改结构体ParamPool的情况下,如何能使用Foreach语句????
}
}