So I have a this class with strings, floats, DateTimes, and data tables
public class Data : IEnumerator
{
string m_PowerSwitch = "Not Tested",
m_SerialNumber = "Not Tested",
m_Reset = "Not Tested",
m_WashPump = "Not Tested",
m_PortB = "Not Tested",
m_PortC = "Not Tested",
m_PortD = "Not Tested",
m_CurlyTube = "Not Tested",
m_BypassTube = "Not Tested";
float m_EC53115VMeasured = 0.0F,
m_EC53165VMeasured = 0.0F,
m_EC531624VMeasured = 0.0F,
m_SolventLineBVolumeMeasured = 0.0F,
m_SolventLineCVolumeMeasured = 0.0F,
m_SolventLineDVolumeMeasured = 0.0F,
m_CurlyTubeVolumeMeasured = 0.0F,
m_BypassTubeVolumeMeasured = 0.0F;
}
I want to use a foreach statement such as
foreach (ASM001.ASM asm in P00001.Global.ListofAvailableASMs)
{
if (asm.ASMData.EndTime == null)
asm.ASMData.EndTime = endTime;
foreach (object data in asm.ASMData)
{
if (data == "Not Tested")
{
asm.ASMData.Result = "FAILED";
}
continue;
}
but I have not been able to find any help of searching through the individual fields of a class, just on a list of the class type.
I am getting the error foreach statement cannot operate on variables of type 'ASM001.Data' because 'ASM001.Data' does not contain a public definition for 'GetEnumerator'
I was wondering if this was possible or if I was going to have to hard code checking each string field by name and returning true or false.
And just so you now there are a lot more strings than what I copied I would have to check, which is why I was wondering if there was a quicker way to do it.