public XElement WriteObject(IEnumerable <IOutputDevice> value) { XmlControllerSerializer controllerSerializer = new XmlControllerSerializer(); IEnumerable <XElement> elements = value.Select(controllerSerializer.WriteObject); return(new XElement(ELEMENT_CONTROLLERS, elements)); }
public IEnumerable <IOutputDevice> ReadObject(XElement element) { List <IOutputDevice> controllers = new List <IOutputDevice>(); XElement parentNode = element.Element(ELEMENT_CONTROLLERS); if (parentNode != null) { XmlControllerSerializer controllerSerializer = new XmlControllerSerializer(); controllers.AddRange(parentNode.Elements().Select(controllerSerializer.ReadObject).NotNull()); } return(controllers); }