Пример #1
0
        public XElement WriteObject(IEnumerable <IOutputDevice> value)
        {
            XmlSmartControllerSerializer serializer = new XmlSmartControllerSerializer();
            IEnumerable <XElement>       elements   = value.Select(serializer.WriteObject);

            return(new XElement(ELEMENT_SMART_CONTROLLERS, elements));
        }
Пример #2
0
        public IEnumerable <IOutputDevice> ReadObject(XElement element)
        {
            List <IOutputDevice> controllers = new List <IOutputDevice>();

            XElement parentNode = element.Element(ELEMENT_SMART_CONTROLLERS);

            if (parentNode != null)
            {
                XmlSmartControllerSerializer serializer = new XmlSmartControllerSerializer();
                controllers.AddRange(parentNode.Elements().Select(serializer.ReadObject).NotNull());
            }

            return(controllers);
        }