Пример #1
0
        public static HomeConfig FromXml(XElement element)
        {
            var obj = new HomeConfig();

            obj.Rooms.AddRange(element.Elements("Room").Select(element => RoomConfig.FromXml(element)));
            return(obj);
        }
Пример #2
0
        public static RoomConfig FromXml(XElement element)
        {
            var obj = new RoomConfig();

            obj.Name        = (string)element.Attribute(nameof(obj.Name));
            obj.Description = (string)element.Attribute(nameof(obj.Description));
            obj.DeviceNames.AddRange(element.Elements("Device").Select(element => (string)element.Attribute("Name")));
            obj.Check();
            return(obj);
        }