private static void WritePilotLampElementNode(XElement parent, Models.Panels.PilotLampElement element) { parent.Add(new XElement("PilotLamp", new XElement("Location", $"{element.LocationX}, {element.LocationY}"), new XElement("Layer", element.Layer), WriteSubjectNode(element.Subject), new XElement("DaytimeImage", element.DaytimeImage), new XElement("NighttimeImage", element.NighttimeImage), new XElement("TransparentColor", element.TransparentColor) )); }
private static void ParsePilotLampElementNode(XElement parent, out PanelElement element) { double[] location = ((string)parent.Element("Location")).Split(',').Select(double.Parse).ToArray(); element = new Models.Panels.PilotLampElement { LocationX = location[0], LocationY = location[1], Layer = (int)parent.Element("Layer"), Subject = ParseSubjectNode(parent.Element("Subject")), DaytimeImage = (string)parent.Element("DaytimeImage"), NighttimeImage = (string)parent.Element("NighttimeImage"), TransparentColor = Color24.ParseHexColor((string)parent.Element("TransparentColor")) }; }