コード例 #1
0
        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();
        }
コード例 #2
0
        public VisualizerSettingsWraper(VisualizerSettingsBase settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            Settings = settings;
        }