示例#1
0
        public static void CalculateContentFileForNet(XDocument contentFile, XMLDefContentFileName xMLDefContent)
        {
            if (contentFile == null)
            {
                throw new ArgumentNullException(nameof(contentFile));
            }

            var attrNameAttrValue = from elem in contentFile.Descendants("Wire")?.Elements("UserAttribute")
                                    where elem.Attribute("AttributeName")?.Value == "NeoNetTAG"
                                    select new Device
            {
                ratp            = elem.Parent.Attribute("Tag")?.Value ?? string.Empty,
                tagNEO          = elem.Attribute("AttributeValue")?.Value ?? string.Empty,
                contentFileName = xMLDefContent.contentFileName
            };

            lock (_netDeviceList)
            {
                AddElements(attrNameAttrValue, "Net", xMLDefContent.roots, _netDeviceList);
            }
        }
        public static void CalculateContentFileForEquipment(XDocument contentFile, XMLDefContentFileName xMLDefContent)
        {
            if (contentFile == null)
            {
                throw new ArgumentNullException(nameof(contentFile));
            }

            var attrNameAttrValue = from elem in contentFile.Descendants("ConnectiveDevice")?.Elements("UserAttribute")
                                    where elem.Attribute("AttributeName")?.Value == "TagNEO" && elem.Parent.Attribute("Type")?.Value == "Equipment"
                                    select new Device
            {
                ratp            = elem.Parent.Attribute("Tag")?.Value,
                tagNEO          = elem.Attribute("AttributeValue")?.Value,
                contentFileName = xMLDefContent.contentFileName
            };

            lock (_eqDeviceList)
            {
                AddElements(attrNameAttrValue, "Device", _eqDeviceList);
            }
        }
示例#3
0
        public static void CalculateContentFileForConnectiveDevice(XDocument contentFile, XMLDefContentFileName xMLDefContent)
        {
            if (contentFile == null)
            {
                throw new ArgumentNullException(nameof(contentFile));
            }

            var attrNameAttrValue = from elem in contentFile.Descendants("ConnectiveDevice")?.Elements("UserAttribute")
                                    where elem.Attribute("AttributeName")?.Value == "TagNEO" &&
                                    (elem.Parent.Attribute("Type")?.Value == "Connector" ||
                                     elem.Parent.Attribute("Type")?.Value == "Shell" ||
                                     elem.Parent.Attribute("Type")?.Value == "ShellModule" ||
                                     elem.Parent.Attribute("Type")?.Value == "TerminalBlock" ||
                                     elem.Parent.Attribute("Type")?.Value == "GroundBlock" ||
                                     elem.Parent.Attribute("Type")?.Value == "Splice" ||
                                     elem.Parent.Attribute("Type")?.Value == "TerminalTrack")
                                    select new Device
            {
                ratp            = elem.Parent.Attribute("Tag")?.Value,
                tagNEO          = elem.Attribute("AttributeValue")?.Value,
                contentFileName = xMLDefContent.contentFileName
            };

            lock (_cdevDeviceList)
            {
                AddElements(attrNameAttrValue, "ConnectiveDevice", _cdevDeviceList);
            }
        }