public Color(XElement element) { Hue = element.Elements().Where(e => e.Name == "hue").Select(e => e.Value).SingleOrDefault(); Rgb = element.Elements().Where(e => e.Name == "rgb").Select(e => string.IsNullOrEmpty(e.Value) ? (int?)null : XmlConvert.ToInt32(e.Value)).SingleOrDefault(); Description = element.Elements().Where(e => e.Name == "description").Select(e => new ColorDescription(e)).SingleOrDefault() ?? new NullColorDescription(); }
public Color(XElement element) { Hue = element.Elements().Where(e => e.Name == "hue").Select(e => e.Value).SingleOrDefault(); Rgb = element.Elements().Where(e => e.Name == "rgb").Select(e => e.Value).SingleOrDefault(); Description = element.Elements().Where(e => e.Name == "description").Select(e => new ColorDescription(e)).SingleOrDefault() ?? new NullColorDescription(); }