public void ReadXml(System.Xml.XmlReader reader) { reader.MoveToElement(); reader.ReadStartElement(); Type instanceType = base.GetType().BaseType; while (reader.IsStartElement()) { if (reader.HasAttributes) { XmlNodeType nodeType = reader.NodeType; Type t = typeof(FileProcessingJournalEntryData <>); t = t.MakeGenericType(Type.GetType(reader.GetAttribute("type"))); string name = reader.GetAttribute("name"); var ser = XmlSerializerCache.GetOrAdd(t, name); object obj = ser.Deserialize(reader.ReadSubtree()); reader.ReadEndElement(); this.EntryData.Add((FileProcessingJournalEntryDataBase)obj); } else { PropertyInfo Prop = instanceType.GetProperty(reader.Name); if (Prop != null) { var h = reader.ReadElementContentAsObject(Prop.Name, ""); Prop.SetValue(this, Convert.ChangeType(h, Prop.PropertyType), null); } } } }
public override object ReadElementContentAsObject() { CheckAsync(); return(_coreReader.ReadElementContentAsObject()); }
public virtual object ReadField(XmlReader xmlReader) { return xmlReader.ReadElementContentAsObject(); }
public virtual void ReadXml(XmlReader reader) { Value = reader.ReadElementContentAsObject(); }