public virtual Data LoadData(IOid oid)
        {
            XDocument doc = XDocument.Load(XmlFile.GetFile(Filename(oid)).FullName);

            CollectionData collection = null;
            ObjectData     objectData = null;
            string         fieldName  = "";

            foreach (XElement element in doc.Descendants())
            {
                LoadNode(element, ref collection, ref objectData, ref fieldName);
            }

            if (objectData != null)
            {
                return(objectData);
            }
            if (collection != null)
            {
                return(collection);
            }
            throw new FindObjectException("No data found for " + oid + " (possible missing file)");
        }
 private static void WriteData(IOid xoid, Data data)
 {
     using (XmlWriter writer = XmlWriter.Create(XmlFile.GetFile(Filename(xoid)).FullName, XmlFile.Settings)) {
         WriteData(data, writer);
     }
 }
 /// <summary>
 ///     Delete the data for an existing instance
 /// </summary>
 protected internal virtual void DeleteData(IOid oid, string type)
 {
     XmlFile.Delete(Filename(oid));
 }