private void Coerce(IXmlCursor cursor, Type clrType, bool replace) { if (replace) { cursor.Remove(); cursor.MoveNext(); cursor.Create(ClrType); } else { cursor.Coerce(clrType); } }
public XmlCollectionAdapter( IXmlNode parentNode, IDictionaryAdapter parentObject, IXmlCollectionAccessor accessor) { items = new List <XmlCollectionItem <T> >(); this.accessor = accessor; this.cursor = accessor.SelectCollectionItems(parentNode, true); this.parentNode = parentNode; this.parentObject = parentObject; this.references = XmlAdapter.For(parentObject).References; while (cursor.MoveNext()) { items.Add(new XmlCollectionItem <T>(cursor.Save())); } }
private void Coerce(IXmlCursor cursor, Type clrType, bool replace) { if (replace) { cursor.Remove(); cursor.MoveNext(); cursor.Create(ClrType); } else cursor.Coerce(clrType); }