Пример #1
0
        public bool Load(IDataLoadable dataLoadable)
        {
            if (!File.Exists || !File.FullName.EndsWith(".playlist"))
            {
                return(false);
            }
            XmlDocument document = new XmlDocument();

            document.Load(File.FullName);
            return(document.DocumentElement != null && dataLoadable.OnLoad(new XmlDataMember(this, document.DocumentElement)));
        }
 /// <summary>
 /// calls DoSelect() and returns only the first record on the result set
 /// </summary>
 /// <param name="d"></param>
 protected void LoadSingleRecord(IDataLoadable d)
 {
     using (IDataReader data = DoSelect())
     {
         if (data.Read())
         {
             d.Load(data);
         }
         else
         {
             throw new NoRecordException();
         }
     }
 }
 public void AddLoadable(IDataLoadable <BuildingData> loadable)
 {
 }
 public void RemoveLoadable(IDataLoadable <BuildingData> loadable)
 {
 }