public void ReadXml(XmlReader reader) { Type type = null; string typeName = reader.GetAttribute("type"); if (!string.IsNullOrEmpty(typeName)) { type = Type.GetType(typeName); } reader.ReadStartElement(); // backward compatibility bool oldFormat = type == null; if (oldFormat) { type = Type.GetType(reader.GetAttribute("type")); reader.ReadStartElement(); } Settings = (VisualizerSettingsBase) new XmlSerializer(type).Deserialize(reader); if (oldFormat) { reader.ReadEndElement(); } reader.ReadEndElement(); }
public VisualizerSettingsWraper(VisualizerSettingsBase settings) { if (settings == null) { throw new ArgumentNullException("settings"); } Settings = settings; }