Changeset 2614


Ignore:
Timestamp:
3/31/2012 11:02:35 PM (2 years ago)
Author:
lowjoel
Message:

Pass the entire XmlReader? to the targets for deserialization since passing a subtree would cause the graph to not load correctly (the parent XmlReader? will not reach the end element, even when the subtree has been read to the end). This prevents us from deserializing multiple items properly if the subitem is an empty element.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Manager/ErasureTargetCollection.cs

    r2612 r2614  
    102102                    foreach (XmlSerializer serializer in targetSerializers) 
    103103                    { 
    104                         XmlReader subTree = reader.ReadSubtree(); 
    105                         if (serializer.CanDeserialize(subTree)) 
     104                        bool targetEmpty = reader.IsEmptyElement; 
     105                        if (serializer.CanDeserialize(reader)) 
    106106                        { 
    107107                            IErasureTarget target = (IErasureTarget) 
    108                                 serializer.Deserialize(subTree); 
     108                                serializer.Deserialize(reader); 
    109109                            list.Add(target); 
    110110                            break; 
     
    113113                } 
    114114 
     115                if (reader.Name != "ErasureTargetCollection") 
     116                    throw new InvalidDataException(); 
    115117                reader.ReadEndElement(); 
    116118            } 
Note: See TracChangeset for help on using the changeset viewer.