private static ProbeBind FromXElement2ProbeBind(XElement elemento, SettingFamily settings) { Probe probe = new Probe(); probe.HwCode = elemento.Element("wHwCode").Value.ToString(); var prbstrcode = elemento.Element("sProbeStringCode").Value.ToString(); probe.ProbeStringCode = prbstrcode == "NULL" ? null : prbstrcode; probe.MultiConnector = Convert.ToBoolean(elemento.Element("fMulticonnSupported").Value); probe.SaleName = elemento.Element("sSaleName").Value.ToString(); probe.ProbeDescription = elemento.Element("sProbeLayoutIcon").Value.ToString(); probeInfo probeInfo = new probeInfo(elemento, settings); return(new ProbeBind(probe, new List <probeInfo> { probeInfo })); }
// add to the probe's infoList the information about the current settings family (the info was loaded in the validProbes structure) private static void updateProbes(List <ProbeBind> oldProbes, List <ProbeBind> validProbes, SettingFamily setting) { foreach (ProbeBind probeBind in oldProbes) { ProbeBind newProbeBind = validProbes.SingleOrDefault(v => v.probe.SaleName.ToLowerInvariant() == probeBind.probe.SaleName.ToLowerInvariant()); probeBind.probeInfoLst.Add(new probeInfo(setting, newProbeBind)); UpdateProbeFields(probeBind.probe, newProbeBind.probe); } }