public override System.Xml.XmlNode ReadFrom(XmlNode parent)
        {
            values = new List<LotFilter>();

            XmlElement lotsElement = parent.SelectSingleNode("child::" + name) as XmlElement;
            if (lotsElement != null)
            {
                XmlNodeList lotElements = lotsElement.SelectNodes("child::LotFilter");

                foreach (XmlNode lotNode in lotElements)
                {
                    if (lotNode is XmlElement)
                    {
                        XmlElement lotElement = lotNode as XmlElement;

                        string mask = lotElement.Attributes.GetNamedItem("LotIdMask").Value;

                        LotFilter lot = new LotFilter(mask);

                        lot.LaserscribesHaveSemiChecksum = Boolean.Parse(lotElement.Attributes.GetNamedItem("LaserscribesHaveSemiChecksum").Value);

                        values.Add(lot);
                    }
                }
            }

            return null;
        }
Exemplo n.º 2
0
        private LotFilter GetLotFilter(XmlElement xmlElement, string prefix)
        {
            XmlNodeList xmlNodeList = xmlElement.GetElementsByTagName(prefix + "Mask");
            string mask = string.Empty;
            if ((xmlNodeList.Count == 1) && (xmlNodeList.Item(0) is XmlElement))
                mask = (xmlNodeList.Item(0) as XmlElement).InnerText;

            LotFilter lotFilter = new LotFilter(mask);

            xmlNodeList = xmlElement.GetElementsByTagName(prefix + "Checksum");
            if ((xmlNodeList.Count == 1) && (xmlNodeList.Item(0) is XmlElement))
                lotFilter.LaserscribesHaveSemiChecksum = Convert.ToBoolean((xmlNodeList.Item(0) as XmlElement).InnerText);

            return lotFilter;
        }